-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
官网提供的uni-ui为什么不兼容H5端? #23
Comments
在单独的.vue文件中引入组件是没问题的,难得不能通过Vue.component('uniBadge',uniBadge)全局注册组件吗? |
这个问题我也想问 |
你想在普通vue web项目里使用uni ui?目前uni ui只支持用uni-app编译为h5 |
全局引入的方式正在修改,可以先在App.vue内使用这种方式引入,近期会修复 |
啥时候修复呀老哥 |
在 App.vue 里面引入是怎么引入全局组件鸭? |
import Vue from 'vue'
import { uniBadge } from '@dcloudio/uni-ui';
Vue.component('uniBadge',uniBadge) |
希望尽快修复 |
+1 |
暂时可以通过这种方式全局注册。你需要将uni-ui的代码复制出来放到项目的目录中 |
官方提供了更简单的引入组件方法,更新到最新alpha可以体验 https://uniapp.dcloud.io/collocation/pages?id=easycom |
uni-ui 现在废弃了 main.js 全局引入的方式,请使用 easyCom的方式 : https://uniapp.dcloud.io/collocation/pages?id=easycom |
当我在main.js中引入uni-ui组件
import { uniBadge } from '@dcloudio/uni-ui';
Vue.component('uniBadge',uniBadge)
然后运行在H5浏览器就会报错:
Uncaught ReferenceError: getApp is not defined
为什么?官网不是说跨全端的吗?
The text was updated successfully, but these errors were encountered: