Keep-alive on a single route instaead of all routes in router-view

前端 未结 1 1925
臣服心动
臣服心动 2021-02-05 10:23

if keep-alive is specified to router-view as below


    

then all

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 11:20

    https://jsfiddle.net/Linusborg/L613xva0/4/

    New in Vue version 2.1.0, the include and exclude props for conditionally caching components. Note the use of the name option.

    const Foo = {
        name: 'foo',
      template: '

    {{ n }}

    ', data: function() { return { numbers: [Math.round(Math.random() * 10), Math.round(Math.random() * 10)] } } } const Bar = { name: 'bar', template: '

    {{ n }}

    ', data: function() { return { numbers: [Math.round(Math.random() * 10), Math.round(Math.random() * 10)] } } }

    0 讨论(0)
提交回复
热议问题