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.

Figure 7.22. Listing group shifted to the left by using translate By binding inline style to the element with<br />

the listing-summary class, we can control the translate from JavaScript. Let's do this via a computed<br />

property so we can calculate the translate amount dynamically.<br />

resources/assets/components/ListingSummaryGroup.vue: <br />

Places in {{ country }} <br />

... ... <br />

export default { props: [ 'country', 'listings' ], computed: {<br />

style() { return { transform: `translateX(-365px)` } } }, components: { ... } }<br />

<br />

Now all of our summary groups will be shifted:

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

Saved successfully!

Ooh no, something went wrong!