0

Current Version : Laravel 5.2 using only Browserify not Webpack

I've already set up everything such as like this:

In my resources/js/app.js

window.Vue = require('vue');

new Vue({   el : '.row',

    data : {        name: ''    }

});

in my view :

<div class="row">
    <input type ="text">
    <h1> @{{ name }} </h1>

</div>

But when i try to refresh it. The DOM just renders for about 2ms or let's say split second then it's gone and there's an error that says :

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build. (found in )

4

1 回答 1

1

您正在使用runtime-only构建,但您可能需要standalone build, 这样做只需将以下内容添加到您package.json的独立构建(包括模板编译器)的别名:

"browser": {
  "vue": "vue/dist/vue.common.js"
}
于 2017-03-14T18:41:39.137 回答