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 image<br />

URLs<br />

The final step is to use these image URLs from the backend instead of the hardcoded<br />

URL. Remembering that images is an array of URLs, we'll use the first<br />

image as a default, that is, images[0].<br />

First, we'll update the entry file, resources/assets/<strong>js</strong>/app.<strong>js</strong>: headerImageStyle: {<br />

'background-image': `url(${model.images[0]})` }<br />

Then the view for the modal image.<br />

resources/views/app.blade.php: <br />

With that done, after a rebuild <strong>and</strong> page refresh, you'll see the content of mock<br />

data listing #5 in the page:

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

Saved successfully!

Ooh no, something went wrong!