万本电子书0元读

万本电子书0元读

顶部广告

Full-Stack Vue.js 2 and Laravel 5电子书

售       价:¥

12人正在读 | 0人评论 9.8

作       者:Anthony Gore

出  版  社:Packt Publishing

出版时间:2017-12-28

字       数:31.5万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Learn to build professional full-stack web apps with Vue.js and Laravel About 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 maintainable Who This Book Is For This 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 Java*. 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 Passport In Detail Vue 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 approach Learn front-end Vue techniques, back-end Laravel skills, and put them together to build a working application
目录展开

Title Page

Copyright

Full-Stack Vue.js 2 and Laravel 5

Credits

About the Author

About the Reviewer

www.PacktPub.com

Why subscribe?

Customer Feedback

Preface

What this book covers

What you need for this book

Operating system

Development tools

Browser

Vue Devtools

IDE

Hardware

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

Hello Vue – An Introduction to Vue.js

Introducing Vue.js

Basic features

Installation

Templates

Directives

Reactivity

Components

Advanced features

Single-file components

Module build

Server-side rendering

The Vue ecosystem

Vue Devtools

Vue Router

Vuex

Case-study project

Vuebnb

Code base

Folders

Summary

Prototyping Vuebnb, Your First Vue.js Project

Vuebnb prototype

Project code

NPM install

Main files

Opening in the browser

Installing Vue.js

Page content

The Vue instance

Data binding

Mock listing

Header image

Style binding

Directives

Usage

Expressions

Example: v-if

Arguments

Style binding (continued)

Lists section

List rendering

Icons

Key

Prices

Show more feature

Class binding

Event listener

Reactivity

Getters and setters

Reactive data properties

Hiding the More button

Image modal window

Opening

Window

Disabling the main window

Dimming the main window

Preventing body scroll

Vue's mount element

Watchers

Closing

Escape key

Event modifiers

Lifecycle hooks

Methods

Proxied properties

Removing listener

Summary

Setting Up a Laravel Development Environment

Laravel

Laravel and Vue

Environment

Homestead

Vuebnb

Project code

Shared folders

Terminal commands

Environment variables

Composer install

Database

Serving the project

Local DNS entry

Accessing the project

Summary

Building a Web Service with Laravel

Vuebnb room listings

Web service

Mock data

Database

Migration

Schema

Execution

Seeding mock listings

Creating a seeder

Loading the mock data

Inserting the data

Executing the seeder

Listing model

Eloquent ORM

Casting

Public interface

Controller

Images

Accessing images

Image links

Summary

Integrating Laravel and Vue.js with Webpack

Laravel frontend

JavaScript

CSS

Node modules

Views

Asset compilation

Webpack

Dependencies

Modules

Bundling

Loaders

Laravel Mix

Running Webpack

CLI

First build

JavaScript

CSS

Fonts

Migrating Vuebnb

Removing unnecessary dependencies and files

HTML

Syntax clash

JavaScript

Mock data dependency

Displaying modules with Webpack

Vue.js dependency

CSS

Font styles

Fonts

Images

Development tools

Watch mode

BrowserSync

ES2015

Polyfills

Mock data

Routes

Architecture

Injecting data

JSON

Sharing data between scripts

Replacing the hard-coded model

Amenities and prices

Image URLs

Replacing the hard-coded image URLs

Summary

Composing Widgets with Vue.js Components

Components

Registration

Data

Image carousel

Changing images

Computed properties

Composing with components

Registration scope

Carousel controls

Communicating with components

Props

One-way data flow

Dynamic props

Image URLs

Distinguishing carousel controls

Custom events

Changing carousel images

Single-file components

Transformation

Refactoring components to SFCs

CSS

CarouselControl

Content distribution

Slots

Modal window

Refs

Header image

Feature lists

Scoped slots

Expandable text

Virtual DOM

Render functions

Vue Loader

Refactoring the main template as single-file component

Mounting the root-level component with a render function

Vue.js builds

Module system

Production builds

Full build vs runtime-only

Selecting a build

Summary

Building a Multi-Page App with Vue Router

Single-page applications

Routers

Vue Router

Special components

Vuebnb routing

Installing Vue Router

Creating routes

App component

Home page

Home route

Initial state

Refactoring

Home page initial state

Adding the thumbnail

Receiving in the client

ListingSummary component

In-app navigation

Adding a path to the model

Route navigation guards

next

HomePage component

Home API endpoint

Axios

Mixins

Moving the solution to a mixin

assignData

Linking to the listing page

Scroll behavior

Adding a footer

The route object

Dynamically selecting the container class

Listing summary image slider

Adding the slider

Translate

Carousel controls

Finishing touches

Summary

Managing Your Application State with Vuex

Flux application architecture

Principle #1 – Single source of truth

Principle #2 – Data is read-only

Principle #3 – Mutations are synchronous

Vuex

Installing Vuex

Save feature

ListingSave component

Saved state

Mutator method

Changing the icon to reflect the state

Adding to ListingPage

Making ListingSave a button

Moving page state into the store

State and mutator methods

Router

Retrieving page state from Vuex

Getters

Checking if page state is in the store

Saved page

Toolbar links

Summary

Adding a User Login and API Authentication with Passport

User model

Migration

Model

Seeder

Login system

LoginPage component

Server routes

CSRF protection

Post-login redirection

Adding authentication links to the toolbar

Protecting the saved route

Passing authentication state to the frontend

auth meta property

Responding to authenticated state

Retrieving saved items from the database

Persisting saved listings

Creating an API route

Vuex actions

AJAX request

API authentication

OAuth

Laravel Passport

Attaching tokens

Summary

Deploying a Full-Stack App to the Cloud

Heroku

CLI

Creating an app

Source code

Environment variables

Creating a database

Default string length

Configuration

Configuring a web server

Passport keys

Deployment

Migration and seed

Serving static assets

Content distribution networks

KeyCDN

Uploading files with FTP

Environment variables

Skipping images

NPM scripts

Production build

Running the FTP script

Reading from the CDN

CDN helper

Setting the CDN URL

Using the CDN in Laravel

Using the CDN in Vue

Deploying to Heroku

Finale

Recap

Next steps

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部