page页面:
<div id="mount-point"></div>
//js引入
import Vue from 'vue';
const compiler = require('vue-template-compiler')
//onload
var C = Vue.extend({
render: compiler.compileToFunctions(
<p>{{firstName}} {{lastName}} aka {{alias}}</p>
).render,
data: () => {
return {
firstName: 'Walter',
lastName: 'White',
alias: 'Heisenberg'
}
}
})
var s = 0
let t = setInterval(() => {
let res = new C().$mount('#mount-point');
s = s + 1
if (s == 6){
clearInterval(t)
}
if (res._isMounted) {
clearInterval(t)
}
}, 200);
0 个回复