Full-Stack Vue.js 2 and Laravel 5
eBook - ePub

Full-Stack Vue.js 2 and Laravel 5

Anthony Gore, ASHLEY MENHENNETT

Share book
  1. 376 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Full-Stack Vue.js 2 and Laravel 5

Anthony Gore, ASHLEY MENHENNETT

Book details
Book preview
Table of contents
Citations

About This Book

Learn to build professional full-stack web apps with Vue.js and LaravelAbout This Book• End-to-end guide on full-stack development with Vue.js 2 and Laravel 5• Developing modern user interfaces with a reusable component-based architecture• Use Webpack to improve applications performance and development workflow• Explore the features of Vuex to build applications that are powerful, consistent, and maintainableWho This Book Is ForThis book targets developers who are new to Vue.js, Laravel, or both, and are seeking a practical, best-practice approach to development with these technologies.They must have some knowledge of HTML, CSS and Javascript.What You Will Learn• Core features of Vue.js to create sophisticated user interfaces• Build a secure backend API with Laravel• Learn a state-of-the-art web development workflow with Webpack• Full-stack app design principles and best practices• Learn to deploy a full-stack app to a cloud server and CDN• Managing complex application state with Vuex• Securing a web service with Laravel PassportIn DetailVue is a JavaScript framework that can be used for anything from simple data display to sophisticated front-end applications and Laravel is a PHP framework used for developing fast and secure web-sites. This book gives you practical knowledge of building modern full-stack web apps from scratch using Vue with a Laravel back end.In this book, you will build a room-booking website named "Vuebnb". This project will show you the core features of Vue, Laravel and other state-of-the-art web development tools and techniques.The book begins with a thorough introduction to Vue.js and its core concepts like data binding, directives and computed properties, with each concept being explained first, then put into practice in the case-study project.You will then use Laravel to set up a web service and integrate the front end into a full-stack app. You will be shown a best-practice development workflow using tools like Webpack and Laravel Mix.With the basics covered, you will learn how sophisticated UI features can be added using ES+ syntax and a component-based architecture. You will use Vue Router to make the app multi-page and Vuex to manage application state.Finally, you will learn how to use Laravel Passport for authenticated AJAX requests between Vue and the API, completing the full-stack architecture. Vuebnb will then be prepared for production and deployed to a free Heroku cloud server.Style and approachLearn front-end Vue techniques, back-end Laravel skills, and put them together to build a working application

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Full-Stack Vue.js 2 and Laravel 5 an online PDF/ePUB?
Yes, you can access Full-Stack Vue.js 2 and Laravel 5 by Anthony Gore, ASHLEY MENHENNETT in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación web. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781788296717

Composing Widgets with Vue.js Components

Components are becoming an essential aspect of frontend development, and are a feature in most modern frontend frameworks, including Vue, React, Angular, Polymer, and so on. Components are even becoming native to the web through a new standard called Web Components.
In this chapter, we will use components to create an image carousel for Vuebnb, which allows users to peruse the different photos of a room listing. We'll also refactor Vuebnb to conform to a component-based architecture.
Topics covered in this chapter:
  • What components are and how to create them with Vue.js
  • Component communication through props and events
  • Single-file components-one of Vue's most useful features
  • Adding custom content to a component with slots
  • The benefit of architecting apps entirely from components
  • How render functions can be used to skip the template compiler
  • Using the runtime-only build of Vue to lighten the bundle size

Components

When we're constructing a template for a web app, we can use HTML elements such as div, table, and span. This variety of elements makes it easy to create whatever structures we need for organizing content on the page.
What if we could create our own custom elements, through, for example, my-element? This would allow us to create reusable structures specifically designed for our app.
Components are a tool for creating custom elements in Vue.js. When we register a component, we define a template which renders as one or more standard HTML elements:
Figure 6.1. Components facilitate reusable markup and render as standard HTML

Registration

There are many ways to register a component, but the easiest is to use the component API method. The first argument is the name you want to give the component, the second is the configuration object. The configuration object will often include a template property to declare the component's markup using a string:
Vue.component('my-component', { template: '<div>My component!</div>' }); new Vue({ el: '#app' });
Once we've registered a component like this, we can use it within our pro...

Table of contents