企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` <body> <div id="app"> <button type="button" @click="add" class="mui-btn mui-btn-blue">添加数据</button> <button type="button" @click="remove" class="mui-btn mui-btn-blue">移除数据</button> <ul> <li v-for="item in arr"> 城市:{{item}} </li> </ul> <ul> <li v-for="val in obj"> 姓名:{{val.name}} </li> </ul> </div> <script type="text/javascript"> var vue=new Vue({ el:"#app", data:{ arr:["北京","上海","深圳"], obj:[ {name:"tom"}, {name:"dash"}, {name:"lili"} ] }, methods:{ add:function(){ alert(1111) this.obj.push({name:"davue"}); }, remove:function(){ this.obj.shift(); } } }); </script> </body> ```