【发布时间】:2021-10-25 06:10:45
【问题描述】:
我正在使用 Inertia.js 创建一个页面。当我在 Vue 模板文件中添加 vue-toastr 时,它不起作用。我不知道如何解决它。请给我建议
这是 app.js
import Vue from 'vue'
import { createInertiaApp } from '@inertiajs/inertia-vue'
import Toastr from 'vue-toastr'
Vue.use(Toastr);
createInertiaApp({
resolve: name => require(`./Pages/${name}`),
setup({ el, App, props }) {
new Vue({
render: h => h(App, props),
}).$mount(el)
},
})
这是 vue 模板文件
<script>
import Master from './Layout/Master';
export default{
name:"Home",
created(){
this.$toastr.s("success","it is working");
},
components:{Master}
};
</script>
【问题讨论】:
-
您需要提供更多背景信息,我们才能为您提供帮助。
-
我需要给你看哪些文件
标签: javascript php laravel vue.js inertiajs