vue 动态加载组建

 

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

 

data () {
    return {
      comp1:'',
    }
}

 

    require.ensure(['./top'], function(require){
      let top1 = require('./top1')
      that.comp1 = top1
    })

 

posted @ 2017-04-10 16:40  zyip  阅读(445)  评论(0编辑  收藏