25.06.2018 Views

Full-Stack Vue.js 2 and Laravel 5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Replacing the hard-coded model<br />

We now have access to our listing model in the entry file, so let's switch it with<br />

our hard-coded model in the data property assignment.<br />

resources/assets/<strong>js</strong>/app.<strong>js</strong>: let model =<br />

JSON.parse(window.vuebnb_listing_model);<br />

var app = new <strong>Vue</strong>({ el: '#app' data: Object.assign(model, { ... }) ... });<br />

With that done, we can now remove the import sample from './data'; statement from<br />

the top of app.<strong>js</strong>. We can also delete the sample data files as they won't be used<br />

any further in the project: $ rm resources/assets/<strong>js</strong>/data.<strong>js</strong><br />

resources/assets/images/header.jpg

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!