1x代码: 它正在发挥作用。
this.$compile(this.$els.ajaxcontent);
2x迁移:
this.$compile(this.$refs.ajaxcontent);
// Error: $compile function not found.
Vue.compile(this.$refs.ajaxcontent);
// Error: template.trim not a function.
Vue.compile($('#ajaxContent').get(0));
// Error: template.trim not a function.
答案 0 :(得分:1)
解决方案:
var tmp = Vue.extend({
template: 'Content'
})
new tmp().$mount(' id or refs ')
答案 1 :(得分:0)
Vue.compile
needs a String. I dont know how exactly how to do it with jquery but try
Vue.compile(document.getElementById('ajaxContent').innerHTML)