$ cnpm install ampersand-virtual-dom-mixin
var vdomMixin = require('ampersand-virtual-dom-mixin');
var View = require('ampersand-view');
var MyView = View.extend(vdomMixin, {
template: require('my-template.jade'), //if useing jadeify, or whatever
initialize: function () {
//you just need to trigger render when things change,
//the simplest might be:
this.on('change', this.render);
}
});
npm run demo
, http://localhost:9967subviews
hash to do so declaratively._parseSubview
. The prepareView function will no longer receive an el
, so rendered subviews will be appended to, rather than replace, the selected el.Copyright 2014 - 2017 © taobao.org |