npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serainleo-mp-ui

v1.0.1-beta.3

Published

mp-ui

Downloads

4

Readme

mp-ui

安装及配置

关于SCSS

mp-ui依赖SCSS,您必须要安装此插件,否则无法正常运行。

  • 如果您的项目是由HBuilder X创建的,相信已经安装scss插件,如果没有,请在HX菜单的 工具->插件安装中找到"scss/sass编译"插件进行安装, 如不生效,重启HX即可
  • 如果您的项目是由vue-cli创建的,请通过以下命令安装对sass(scss)的支持,如果已安装,请略过。
// 安装sass
npm i sass -D

// 安装sass-loader,注意需要版本10,否则可能会导致vue与sass的兼容问题而报错
npm i sass-loader@10 -D

准备工作

在进行配置之前,请确保您已对mp-ui进行了npm安装,如果没有,请先执行安装:

// 如果您的项目是HX创建的,根目录又没有package.json文件的话,请先执行如下命令:
// npm init -y

// 安装
npm install @swsc/mp-ui

配置

配置easycom组件模式

此配置需要在项目src目录的pages.json(使用了uni-simple-router的项目为pages.js)中进行。

:::tip 温馨提示

  1. uni-app为了调试性能的原因,修改easycom规则不会实时生效,配置完后,您需要重启HX或者重新编译项目才能正常使用mp-ui的功能。
  2. 请确保您的pages.json中只有一个easycom字段,否则请自行合并多个引入规则。 :::
// pages.json
{
	"easycom": {
      "autoscan": true,
      "custom": {
		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue",
		"^sw-(.*)": "@swsc/mp-ui/components/sw-$1/sw-$1.vue",
		"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
	  }
	},
	
	// 此为本身已有的内容
	"pages": [
		// ......
	]
}

引入mp-ui的全局SCSS主题文件

在项目src目录的uni.scss中引入此文件。

/* uni.scss */
@import '@swsc/mp-ui/theme.scss';

3. 引入mp-ui基础样式

:::danger 注意! 在App.vue首行的位置引入,注意给style标签加入lang="scss"属性 :::

<style lang="scss">
	@import "@swsc/mp-ui/index.scss";
</style>