0
我試圖在的jsfiddle的toastr圖書館工作,但我不斷收到此錯誤:未捕獲的SyntaxError:意外的令牌進口意外令牌進口 - 的jsfiddle
這是我的jsfiddle:https://jsfiddle.net/50wL7mdz/77255/
這是我的代碼:
import VueToastr from '@deveodk/vue-toastr';
Vue.use(VueToastr, {
defaultPosition: 'toast-bottom-left',
defaultType: 'info',
defaultTimeout: 1000
});
new Vue({
el: '#app',
data: {
},
created(){
this.$toastr('success', 'it works!', 'Yeahh');
},
methods: {
}
})
,這是圖書館參考:https://github.com/Deveodk/vue-toastr
是否進口關鍵字不行我n jsfiddle?
由於它的工作。你能解釋爲什麼你改變我的行'this。$ toastr('success','it works!','Yeahh');'成功的方法嗎? 'toastr.success('Message','Title');'爲什麼我的代碼不能運行'this。$ toastr('success','It works!','Yeahh');' –
Read這裏的文檔https://www.npmjs.com/package/vue-toastr-2。和參數 – Sajeetharan
但是這裏https://github.com/Deveodk/vue-toastr這個代碼給出了'this。$ toastr('success','它工作!','Yeahh')'它只會在導入時才起作用已啓用? –