怎么做网站建设,溧水区城乡建设局网站,如何制作企业宣传片视频,专业做网站建设建站使用过uniapp的#xff0c;大家应该都对uview不陌生。
原来vue2的版本中#xff0c;uview解决了我大部分的麻烦事。奈何现在要用vue3#xff0c;你还不支持。
记录一下uview-plus的使用之路吧。
uview-plus的地址
零云uview-plus3.0重磅发布#xff0c;全面的Vue3鸿蒙移…使用过uniapp的大家应该都对uview不陌生。
原来vue2的版本中uview解决了我大部分的麻烦事。奈何现在要用vue3你还不支持。
记录一下uview-plus的使用之路吧。
uview-plus的地址
零云®uview-plus3.0重磅发布全面的Vue3鸿蒙移动组件库。 - DCloud 插件市场
uview2的地址
uView2.0重磅发布利剑出鞘一统江湖 - DCloud 插件市场 开始使用
1.uni建v3的项目 2.导入插件 3.配置main.js
// main.js这里
import uviewPlus from /uni_modules/uview-plus// #ifdef VUE3
import { createSSRApp } from vue
export function createApp() {const app createSSRApp(App)//这里app.use(uviewPlus)return {app}
}
// #endif
4.配置uni.scss
加入这句话放在第一行
import /uni_modules/uview-plus/theme.scss;
5.配置App.vue
style langscss/*加这句话放第一行*/import /uni_modules/uview-plus/index.scss;
/style
6.配置manifest
关键代码mergeVirtualHostAttributes : true
mp-weixin : {appid : ,...mergeVirtualHostAttributes : true
},
mp-toutiao : {appid : ,...mergeVirtualHostAttributes : true
}
7.pages.json中添加代码来配置easycom组件模式
加上这个记得关了编辑器。重新在打开才起效果
easycom: {autoscan: true,// 注意一定要放在custom里否则无效https://ask.dcloud.net.cn/question/131175custom: {^u--(.*): /uni_modules/uview-plus/components/u-$1/u-$1.vue,^up-(.*): /uni_modules/uview-plus/components/u-$1/u-$1.vue,^u-([^-].*): /uni_modules/uview-plus/components/u-$1/u-$1.vue}},
8.安装依赖库
npm i dayjs
npm i clipboard
9.测试
在组件库中随便加一个组件然后运行项目测试是否运行成功