华玥组件库
温馨提示
node(推荐) >= 16.14.0 sass(推荐) 1.53.0<=sass<=1.78.0
🚀 下载scss(没有的话需要安装)
提示
华玥组件库使用的是scss,所有对于没有使用scss插件的需要安装scss插件
shell
$ npm install -D sass@1.53.0shell
$ pnpm add -D sass@1.53.0shell
$ cnpm install -D sass@1.53.0shell
$ yarn add -D sass@1.53.0🌈下载dayjs(没有的话需要安装)
提示
由于时间选择器使用到dayjs,所有在使用时候需要下载dayjs,否则会报错
shell
$ npm install dayjsshell
$ pnpm add dayjsshell
$ cnpm install dayjsshell
$ yarn add dayjs🌵 安装组件
shell
$ npm install hy-appshell
$ pnpm add hy-appshell
$ cnpm install hy-appshell
$ yarn install hy-app🌳 导入使用组件
html
<!-- 然后在所需页面直接使用 -->
<hy-input></hy-input>在pages.json文件引入全局组件库
json
{
"easycom": {
"custom": {
"^hy-(.*)": "hy-app/components/hy-$1/hy-$1.vue"
}
}
}🐔 导入scss文件
在uni.scss最顶部引入这些文件
scss
@use "hy-app/libs/css/theme.scss" as *;
@use "hy-app/libs/css/common.scss" as *;
@use "hy-app/libs/css/mixin.scss" as *;
