1类文件
function CLASS_VUE() { this.start=function (selector,dataObject) { var gb={el: selector, data: dataObject}; return new Vue(gb); }; this.startMethod=function (selector, dataObject, methodObject) { var gb={el: selector, data: dataObject,methods:methodObject}; return new Vue(gb); }; this.startComputed=function (selector,dataObject,computedObject) { var gb={el: selector, data: dataObject,computed:computedObject}; return new Vue(gb); }; }
<div id="computed"> sum={{sum}} </div> <script> var vuee=new CLASS_VUE(); var sumObject={sum:function () { return this.a+1; }}; vuee.startComputed('#computed',{a:1},sumObject) </script>