zoukankan      html  css  js  c++  java
  • vue动态组件,组件缓存

    1、动态组件

    动态组件  is属性的值与组件名称相匹配,匹配到哪个组件就显示哪个组件

    <component  :is="name"></component>

    2、组件缓存

      表示所有的动态组件都会缓存

      <keep-alive>

        <component  :is="name"></component>

      </keep-alive>

      

      表示只有include匹配的组件才会缓存

      <keep-alive  include="testA, testC">

        <component  :is="name"></component>

      </keep-alive>

      

      除了exclude匹配的组件不缓存,其它组件都会缓存

      <keep-alive  exclude="testA, testC">

        <component  :is="name"></component>

      </keep-alive>

  • 相关阅读:
    求某个数的位数公式
    ArrayList和lInkedList比较
    队列
    抽象数据结构-栈
    LinkedList的实现
    ArrayList的实现
    Iterator和List的一些问题
    SCHEMA约束
    DTD约束
    XML解析
  • 原文地址:https://www.cnblogs.com/cuishuangshuang/p/13161115.html
Copyright © 2011-2022 走看看