j***@wanda.com.cn
j***@wanda.com.cn
  • 发布:2023-05-14 11:24
  • 更新:2023-05-14 11:24
  • 阅读:134

微信小程序使用Vue.extend vue-template-compiler无效 打包成h5没问题

分类:uni-app

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);

2023-05-14 11:24 负责人:无 分享
已邀请:

要回复问题请先登录注册