我有一个自定义的Vue组件,位于Laravel默认路径中:
因此,我安装了Laravel-Nova,并希望在视图部分中使用组件。
<dropdown-menu slot="menu" width="200" direction="rtl">
<my-component></my-component>
<ul class="list-reset">
<li>
...我应该在哪里导入组件?换言之,我应把:
import MyComponent from '/path/to/my/component/MyComponent.vue'
//and
Vue.component('my-component', MyComponent)我想以某种方式在Vue组件的代码中使用Nova JavaScript Helpers,比如:
this.$toasted.show('It worked!', { type: 'success' })
//or
axios.get('/nova-vendor/stripe-inspector/endpoint').then(response => {
// ...
})发布于 2020-05-01 15:28:59
这是一个类似组件的例子:
import MyLens from './components/views/Lens';
Nova.booting((Vue, router, store) => {
router.addRoutes([{
name: 'nova-improvements',
path: '/nova-improvements',
component: require('./components/Tool'),
}])
});
Nova.booting((Vue, router, store) => {
Vue.component('lens', MyLens)
});https://stackoverflow.com/questions/61420200
复制相似问题