uni-app项目vue3环境下无法使用uni-ui
uni-app项目vue3环境下无法使用uni-ui
7 回复
摸出来了,这个应该是sass-loader的版本太高导致的,现在可以编译了,但是在vue3中没有$refs了,该怎么使用这个popup呢?
更多关于uni-app项目vue3环境下无法使用uni-ui的实战教程也可以访问 https://www.itying.com/category-93-b0.html
用法不变,只是ref不支持数组了,看下ref文档就知道怎么回事
怎么使用的啊?getCurrentInstance吗?
对,用getCurrentInstance去拿ref
回复 2***@qq.com: 用不了,拿不到ref
在 uni-app 的 Vue3 环境下使用 uni-ui 确实需要一些额外配置,以下是解决方案:
- 安装 uni-ui:
npm install @dcloudio/uni-ui
- 配置 easycom(在
pages.json中):
{
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
}
}


