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.

App. This is so the toolbar is in the domain of <strong>Vue</strong>; before it was outside of the<br />

mount point <strong>and</strong> therefore untouchable by <strong>Vue</strong>. I've done this so that later we can<br />

make the main logo a link to the home page using RouterLink, as this is a<br />

convention for most websites. I've moved any toolbar related CSS into the style<br />

element as well.<br />

resources/assets/components/App.vue: vuebnb <br />

#toolbar { display: flex; align-items:<br />

center; border-bottom: 1px solid #e4e4e4; box-shadow: 0 1px 5px rgba(0, 0, 0,<br />

0.1); } #toolbar .icon { height: 34px; padding: 16px 12px 16px 24px; display:<br />

inline-block; } #toolbar h1 { color: #4fc08d; display: inline-block; font-size:<br />

28px; margin: 0; } <br />

With that done, if you now navigate the browser to a URL like /listing/1, you'll<br />

see everything looks the same as it did before. However, if you look at <strong>Vue</strong><br />

Devtools, you'll see the component hierarchy has changed, reflecting the<br />

addition of the App component.<br />

There's also an indicator, which tells us that the ListingPage component is the<br />

active page component for <strong>Vue</strong> Router:

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

Saved successfully!

Ooh no, something went wrong!