uni-app imports uViewUI component library
uViewUI official documentation
https://www.uviewui.com/components/intro.html
1. First install the uViewUI and SCSS plugins through npm
//安装uViewUI
npm install uview-ui
// 安装node-sass
npm i node-sass -D
// 安装sass-loader
npm i sass-loader -D
At this point the file list is as follows:
2. Next, import uView in main.js
import uView from "uview-ui";
Vue.use(uView);
3. Then introduce the uView global file in uni.scss
/* 引入uView的全局文件 */
@import 'uview-ui/theme.scss';
4. Then introduce the uView basic style in App.vue
<style lang="scss">
@import "uview-ui/index.scss";
</style>
5. Finally configure the easycom component mode
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
At this point, the import of the uViewUI component library has been completed.
Let's test it out:
(For reference: https://blog.csdn.net/qq_40976321/article/details/106453181)