1.0.0 • Published 10 months ago

@foundbyte/uni-ui-demo v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

uni-ui 自定义组件

构建

pnpm build

存储于packages/uni-ui/src/packages,可自行发布

使用

  1. 安装
npm i @foundbyte/uni-ui
  1. 配置

根目录添加 vue.config.js 文件

module.exports = {
    transpileDependencies:['@foundbyte/uni-ui']
}

src/pages.json 添加以下配置

{
	"easycom": {
		"autoscan": true,
		"custom": {
			// uni-ui 规则如下配置
			"^uni-(.*)": "@foundbyte/uni-ui/lib/uni-$1/uni-$1.vue"
		}
	},
	"pages": [
		...
	]
}
  1. 样式

packages/uni-project/src/App.vue

@import '@foundbyte/uni-ui/lib/uni-scss/index.scss';
  1. 项目中即可使用
<template>
  <view class="content">
    <uni-badge class="uni-badge-left-margin" text="1" />
  </view>
</template>