标签:function template reject 分割 example ... webp 回调函数 回调
<body>
<div id="app">
<async-example></async-example>
</div>
<script>
//异步组件
Vue.component(‘async-example‘,function(resolve,reject){
setTimeout(function(){
//将组件定义传入resolve回调函数
resolve({
template:‘<div>I am async</div>‘
})
},1000)
})
new Vue({
el:"#app"
})
//webpack代码分割暂时省略还不会
//...
//
</script>
</body>
标签:function template reject 分割 example ... webp 回调函数 回调
原文地址:http://www.cnblogs.com/ItIsInteresting/p/7744955.html