1

I have a custom Vue-Component located in Laravel default path for it:

  • resources/js/components/MyComponent.vue

So, I installed Laravel-Nova and want to use the component inside a view partial

  • resources/views/vendor/nova/partials/user.blade.php
<dropdown-menu slot="menu" width="200" direction="rtl">

    <my-component></my-component>

    <ul class="list-reset">
        <li>
        ...

Where should I import the Component? In other words, where should I place the:

import MyComponent from '/path/to/my/component/MyComponent.vue'

//and

Vue.component('my-component', MyComponent)

I want to do it some way I can use inside the code of the Vue Component the Nova JavaScript Helpers, like:

this.$toasted.show('It worked!', { type: 'success' })

//or

axios.get('/nova-vendor/stripe-inspector/endpoint').then(response => {
    // ...
})

1 Answer 1

0

This is an example of a similar component:

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)
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.