uni-app imports uViewUI component library

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:

insert image description here
2. Next, import uView in main.js

import uView from "uview-ui";
Vue.use(uView);

insert image description here
3. Then introduce the uView global file in uni.scss

/* 引入uView的全局文件 */
@import 'uview-ui/theme.scss';

insert image description here
4. Then introduce the uView basic style in App.vue

<style lang="scss">
	@import "uview-ui/index.scss";
</style>

insert image description here

5. Finally configure the easycom component mode

"easycom": {
		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}

insert image description here

At this point, the import of the uViewUI component library has been completed.
Let's test it out:
insert image description here
insert image description here

(For reference: https://blog.csdn.net/qq_40976321/article/details/106453181)

Guess you like

Origin blog.csdn.net/ws15168689087/article/details/122027252
Recommended