I'm working on a Laravel 5.2 project with Laravel Spark (which is still in beta at the time of writing) and trying to add some Vuejs functionality using the default layouts and views.
My first attempt failed because I just tried to create a new one div
in the home view and bind the Vue code to this div
. Here div
:
<div id="my-stuff">
<p>@{{ test }}</p>
</div>
And here is the corresponding JS code:
new Vue( {
el: '#my-stuff',
data: {
test: 'This is a test'
}
});
What I expected to see is the words “This is a test” that appear in this div on the main screen, but of course nothing appeared, because, as already mentioned, Vue is attached to div
immediately after the body tag (well, I assume that one way or another).
, - Vue, , , , Gulp, Spark ( ?), , Vue.
.
1
, , Laravel 5.2, , app.js
, , public
, div
home
script, app.js
script, javascript, gulp.
, , :
https://jsfiddle.net/5oLLte2e/
AngularJS. , , Vuejs, , , - , , Gulp config, .