[Vuejs]-How to include vue-component from public folder (Laravel 5.5)

0👍

References:

In your app.js (entry file):

Global registration:

Vue.component('cropper-admin', require('./js/component.vue'));

Local registration:

import 'component' from './js/component.vue'

new Vue({
el: '#appCropper',
components: {
    'cropper-admin': component
 }
});

component.vue:

<template>
 <div>{{ text }}</div>
</template>

<script>
 export default {
   data() {
  return { text: 'test }
  }
}
</script>

Hope this helps to get you started

Leave a comment