0

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.

ドキュメントのコンパイル: http://vuejs.org/api/#Vue-compile

4

2 に答える 2

1

解決:

var tmp = Vue.extend({ 
    template: 'Content'
})
new tmp().$mount(' id or refs ')
于 2016-10-17T09:37:40.367 に答える