Reputation: 836
1x Code: It is working.
this.$compile(this.$els.ajaxcontent);
2x Migration:
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.
Compile Documentation : http://vuejs.org/api/#Vue-compile
Upvotes: 0
Views: 477
Reputation: 836
Solution:
var tmp = Vue.extend({
template: 'Content'
})
new tmp().$mount(' id or refs ')
Upvotes: 1
Reputation: 474
Vue.compile
needs a String. I dont know how exactly how to do it with jquery but try
Vue.compile(document.getElementById('ajaxContent').innerHTML)
Upvotes: 0