下载IView Weapp
https://github.com/TalkingData/iview-weapp
导入文件
下载完后将dist文件夹中的所有文件(也可以只选择需要的组件)导入到mpvue项目的static文件夹中。
使用组件
在需要使用组件的页面中配置。
main.js
import Vue from 'vue'
import App from './index'
const app = new Vue(App)
app.$mount()
export default {
config: {
usingComponents: {
'i-card': '../../../static/iview/card/index'
}
}
}
然后在页面中使用标签就可成功调用
<i-card full title="卡片标题" extra="额外内容" thumb="https://i.loli.net/2017/08/21/599a521472424.jpg">
<view slot="content">内容不错</view>
<view slot="footer">尾部内容</view>
</i-card>