【发布时间】:2019-10-28 02:39:34
【问题描述】:
我无法让 ant-design-vue 通知(或消息)在我使用 vue-cli 3 创建的项目中工作。我正在使用来自 https://vue.ant.design/components/notification/ 的示例,但通知没有出现。
在 GitHub 上对 ant-design-vue 问题做了一些研究后,我认为这可能是由于 ant-design-vue 本身的缺陷造成的。当调用全局渲染函数时,它似乎不支持通知消息,由 vue-cli 3 创建,如下所示:
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
由于这个问题,我认为这是一个缺陷:
https://github.com/vueComponent/ant-design-vue/issues/554
如果我使用这种样式来创建我的 Vue 对象,我相信 ant-design-vue Notification 会起作用:
new Vue({
el: '#app',
components: { App },
template: '<App/>'
})
但是,当我将 main.js 更改为使用第二种创建 Vue 组件的样式时,我的 SPA 中没有任何内容呈现。所以我被卡住了 - 我不能使用 ant-design-vue 通知,因为我认为它不适用于渲染:h => h(App),我也不能切换我创建 Vue 应用程序的方式我认为适用于通知。
感谢您的帮助 - 我是 Javascript、Vue 和 Ant Design 的新手。
【问题讨论】: