Vue 技巧

1、在 v-html 中执行 vue 绑定的事件,默认是不能执行的。这里需要把 html 重新解析一下

loadMsg:function(html){
    html = $.parseHTML(html)[0];
    this.vm.$compile(html);
    while (this.el.firstChild) {
        this.el.removeChild(this.el.firstChild);
    }
    this.el.appendChild(html);
}

posted on 2016-03-22 14:46  松鼠闹IT  阅读(186)  评论(0编辑  收藏  举报

导航