1、在项目目录下 npm安装
npm init -y
npm install @dcloudio/uni-ui
例如日期组件
<template>
<view>
<uni-calendar
:insert="true"
:lunar="true"
:start-date="'2019-3-2'"
:end-date="'2019-5-20'"
@change="change"
/>
</view>
</template>
<script>
// 引入只更换解构部分
import {uniCalendar} from '@dcloudio/uni-ui'
export default {
// 注册
components: {
uniCalendar
},
data() {
return {};
},
methods: {
change(e) {
console.log(e);
}
}
};
</script>
<style lang="scss">
</style>
2、使用官网上的 使用hbuilderx导入插件把它里面的文件拿出来,需要修改样式用穿透
穿透的三种方式
使用 >>>
使用 /deep/
使用 ::v-deep
1、style的样式穿透 使用 >>>
2、sass 和 less 的样式穿透