Vue's slots enable you to define where content of a component should land when you define the content inside of a parent component. You can also name slots to arrange the elements however you'd like and allow your component to build it's own content…
Components with slots can expose their data by passing it into the slot and exposing the data using slot-scope in the template. This approach allows you to pass props down from Parent components to Child components without coupling them together. For…
Because async components are not bundled with your app, they need to be loaded when requested. This means that your network could be slow, go down, or the file could be completely missing. This lesson shows you how to handle these scenarios with Vue…
@Prop  父子组件之间传值 Install: npm install --save vue-property-decorator Child: <template> <div> {{fullMessage}} </div> </template> <script lang="ts"> import Vue from 'vue' import {Component, Prop} from 'vue-property-deco…
1.本文将讲述 方法 Vue.extend Vue.mixin 与 new Vue({mixins:[], extend:{}})的区别与原理 先回顾一下 Vue.mixin 官网如下描述: Vue.mixin( mixin )全局注册一个混入,影响注册之后所有创建的每个 Vue 实例.插件作者可以使用混入,向组件注入自定义的行为. 既然可以影响到注册后的所有实例,那么该方法注入的方法和属性都存放在哪里呢(构造函数的options属性上),我们一起来看看该方法的定义 Vue.mixin = fu…
Vue.use Vue.use 的作用是安装插件 Vue.use 接收一个参数 如果这个参数是函数的话,Vue.use 直接调用这个函数注册组件 如果这个参数是对象的话,Vue.use 将调用 install 方法来注册组件 * 官方文档: * Vue.use 用于安装 Vue.js 插件. * 如果插件是一个对象,必须提供 install 方法 * 如果插件是一个函数,它会被作为 install 方法 * install 方法调用时,会将 Vue 作为参数传入 Vue.component Vu…
A common scenario is to present different components based on the state of the application. Dynamic components in Vue make this simple by providing a component element that simply needs to be bound to the component that you want to render. This examp…
一.报错截图 [Vue warn]: Unknown custom element: <wzwzihello> - did you register the component correctly? For recursive components, make sure to provide the "name" option. 错误代码 <!DOCTYPE html> <html lang="en"> <head>…
This lesson shows how you can extend and reuse logic in Vue components using TypeScript inheritance. It will take you through extending a component, its properties and methods, and how hooks are triggered along the inheritance tree. We can define a P…
While traditional Vue components require a data function which returns an object and a method object with your handlers, vue-class-componentflattens component development by allowing you to add your data properties and handlers directly as properties…