magix-components
Version:
1 lines • 1.99 kB
JavaScript
define("mx-pagination/__test__/index",["magix","../index"],function(i,e,t){i("../index");var a=i("magix");t.exports=a.View.extend({tmpl:{html:'<h2>mx-pagination</h2><h3>完整模式</h3><div class="B ag"><div mx-guid="g0" class="Z" mx-view="mx-pagination/index?total=2000&step=3&page=<%!$eu($$.page)%>"></div><button class="al" mx-click="test()">test</button></div><div class="B"><div>HTML Code:</div><pre><mx-pagination\n total="2000"\n step="3"\n page="2"\n class="fl"/></pre></div><h3 class="f">简单模式</h3><div class="B ag"><div mx-view="mx-pagination/index?total=2000&step=5&simplify=true&page=15"></div></div><div class="B"><div>HTML Code:</div><pre><mx-pagination\n total="2000"\n step="5"\n simplify="true"\n page="15"/></pre></div><h3 class="f">迷你模式</h3><div class="B ag"><div mx-view="mx-pagination/index?total=2000&step=5&mini=true&page=10"></div></div><div class="B"><div>HTML Code:</div><pre><mx-pagination\n total="2000"\n step="5"\n mini="true"\n page="10"/></pre></div><h3 class="f">监听change事件</h3><div class="B ag"><div mx-change="show()" mx-view="mx-pagination/index?total=2000&step=5&page=10"></div></div><div class="B"><div>HTML Code:</div><pre><mx-pagination\n total="2000"\n step="5"\n page="10"\n mx-change="show()"/></pre><div class="z">Javascript Code:</div><pre>let Magix = require(\'magix\');\nmodule.exports = Magix.View.extend({\n tmpl: \'@index.html\',\n render() {\n let me = this;\n me.updater.digest();\n },\n \'show<change>\' (e) {\n console.log(e.page, e.size);\n }\n});</pre></div>',subs:[{keys:["page"],path:'div[mx-guid="g0"]',attr:'mx-view="mx-pagination/index?total=2000&step=3&page=<%!$eu($$.page)%>"',attrs:[{n:"mx-view",v:1}]}]},render:function(){this.updater.digest({page:1})},"show<change>":function(i){},"test<click>":function(i){var e=this.updater.get("page");this.updater.digest({page:e+1})}})});