25.06.2018 Views

Full-Stack Vue.js 2 and Laravel 5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

esources/assets/components/SavedPage.vue: <br />

Saved listings <br />

No saved listings.<br />

... ...<br />

Lastly, we'll add to the style tag. The main thing to note here is that we're<br />

utilizing the flex-wrap: wrap rule <strong>and</strong> justifying to the left. This ensures that our<br />

listing summaries will organize themselves in rows without gaps.<br />

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

#saved .listing-summaries { display: flex; flex-wrap: wrap;<br />

justify-content: left; overflow: hidden; } #saved .listing-summaries .listingsummary<br />

{ padding-bottom: 30px; } .listing-summaries > .listing-summary {<br />

margin-right: 15px; } <br />

Let's also add the .saved-container CSS rules in our global CSS file. This ensures<br />

that our custom footer has access to these rules as well.<br />

resources/assets/css/style.css: .saved-container { margin: 0 auto; padding: 0 25px;<br />

} @media (min-width: 1131px) { .saved-container { width: 1095px; paddingleft:<br />

40px; margin-bottom: -10px; } }<br />

The final task is to add some default saved listings to the store. I've chosen 1 <strong>and</strong><br />

15 at r<strong>and</strong>om, but you can add any you want. We'll remove these again in the<br />

next chapter when we use <strong>Laravel</strong> to persist saved listings to the database.<br />

resources/assets/<strong>js</strong>/store.<strong>js</strong>: state: { saved: [1, 15], ... },<br />

With that done, here's what our saved page looks like:

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

Saved successfully!

Ooh no, something went wrong!