Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Import\Create custom VueJS component to the view file!

    Modules
    2
    2
    482
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Serhii last edited by

      I want to create my Vue component and display it on the page, but I can't do it.
      First of all, I added example.vue file to the: /packages/Webkul/Velocity/src/Resources/assets/js/UI/components/example.vue.
      Then in the file: packages/Webkul/Velocity/src/Resources/assets/js/app.js I added next lines

      import VueExample from 'example-component';
      
      Vue.use(VueExample);
      
      Vue.component('example-component', require('./UI/components/example'));
      

      In the view file: resources/themes/velocity/views/products/view.blade.php, I added <example-component></example-component> but nothing happens.
      This is the first time I do it) How can I add this component?

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi @Serhii,

        Did you compile your assets?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post