1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravelデフォルトのapp.jsをES2015以降の設定で書く

Last updated at Posted at 2019-07-06

ここの部分。


//resources/assets/js/app.es5.js
window.Vue = require('vue');

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

Vue.component('example', require('./components/Example.vue'));

const app = new Vue({
    el: '#app'
});

こう書くとちょっとスッキリする気がする。

//resources/assets/js/app.es2015.js
import Vue from 'vue'
import App from './components/Example'

new Vue({
    el: '#app',
    components: {
        app: App
    }
})
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?