laravelvue.jsbrowserifyvueify

Vue 2.2.2 doesn't display the data to the View


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 )


Solution

  • You're using the runtime-only build but you likely need the standalone build, to do that simply add the following to your your package.json to alias the standalone build (which includes the template compiler) :

    "browser": {
      "vue": "vue/dist/vue.common.js"
    }