mardi 24 juillet 2018

Laravel package including Vuejs import or build package vuejs files for building app

I have made a package XYZ and in this package i have somes files with the vue structure. Now i want to run npm run dev or later prod to build this to my public/js

How do i have to setup my webpack.mix.js to import package vue files?

  • vendor/packages/components/App.vue
  • vendor/packages/app.js

app.js

Window.Vue = require('vue');

import VueRouter from 'vue-router'
Vue.use(VueRouter);

import AppBanners from './components/App.vue'


const router = new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/path/to/xxxxx',
            name: 'here-comes-name',
            component: App,
        }
    ],
});

const app = new Vue({
    el: '#here-comes-id',
    router,
});

App.vue

<template>
    <transition name="fade" mode="out-in">
        <div>
            index
        </div>
    </transition>
</template>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire