0
我使用這個庫VUE-通知:https://github.com/cristijora/vue-notifyjsVue的組件沒有渲染
上述頁面狀態的文檔:component: { //is rendered instead of notification message
因此我想給它動力組件,這樣我可以處理自定義事件。這是我的代碼:
Vue.use(vueNotifyjs)
new Vue({
el: '#app',
methods: {
addNotification(verticalAlign = 'top', horizontalAlign = 'right') {
this.$notify({
component: function(){
return {
template: '<h1>Hello</h1>'
};
},
horizontalAlign: horizontalAlign,
verticalAlign: verticalAlign,
type: "success"
})
}
}
})
這是我的jsfiddle:https://jsfiddle.net/z11fe07p/2706/
但這個詞Hello
未在通知得到呈現。任何想法我錯過了什麼?
好bhai。謝謝。 –