使用partials进行Ractive拆卸/重新渲染不会重新渲染部分内容

时间:2015-07-15 17:58:55

标签: ractivejs

这是小提琴(抱歉警告)http://jsfiddle.net/PCcqJ/92/

var ractive = new Ractive({
    template: '#templateOne',
    partials: {
        aPartial: '<div>Oh look, the partial is rendered!</div>'
    }
});

function cb() {
    alert('but now we unrender');
    ractive.once('complete', function() {
        alert('we rendered again, and now you can\'t see the partial content');
    });
    ractive.render('container');
}

ractive.render('container');

ractive.once('complete', function() {
    alert('so we render the first time, and you can see the partial');
    ractive.unrender().then(cb);    
});

此处的部分不会重新渲染。为什么是这样?部分仍然在partials对象中,并且它们已被取消渲染,那么是什么会阻止它们再次渲染?

这个小提琴渲染,渲染,然后重新渲染,每当其中一个发生时就会发出警报。

0 个答案:

没有答案
相关问题