UNI-UI安装

2019-01-13  本文已影响0人  e0c52543163a

在 HBuilderX 中新建 uni-app 项目,进入项目目录,执行:

npm init -y

安装 uni-ui

npm install @dcloudio/uni-ui

使用 uni-ui

script 中引用组件:

<pre class="editor editor-colors" style="font-family: monospace, monospace; font-size: 1em; box-sizing: border-box; margin-top: 0px; margin-bottom: 24px; padding: 13px 15px; background: rgb(247, 247, 247); border-radius: 2px; overflow-x: auto;">

import uniBadge from '@dcloudio/uni-ui/lib/uni-badge/uni-badge.vue'

export default {

components: {uniBadge}

}

</pre>

template 中使用组件:

<pre class="editor editor-colors" style="font-family: monospace, monospace; font-size: 1em; box-sizing: border-box; margin-top: 0px; margin-bottom: 24px; padding: 13px 15px; background: rgb(247, 247, 247); border-radius: 2px; overflow-x: auto;">

<uni-badge text="1"></uni-badge>

<uni-badge text="2" type="purple" @click="bindClick"></uni-badge>

<uni-badge text="3" type="primary" :inverted="true"></uni-badge>

</pre>

mkdir -p D:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32-x64-57

cd D:\HBuilderX\plugins\compile-node-sass\node_modules\node-sass-china\vendor\win32-x64-57

curl -o binding.node http://cdn.npm.taobao.org/dist/node-sass/v4.7.2/win32-x64-57_binding.node

上一篇下一篇

猜你喜欢

热点阅读