vuejs 實現jq 克隆的功能

元寶_發表於2019-04-30
<div class="layui-card-header travelInfo">
            <span >行程說明</span>
            <span class="layui-btn layui-btn-sm layui-btn-normal fr" @click="addTravel">新增行程</span>
          </div>
<div class="layui-card-body addTravel" ref="addTravel" v-for="item in cloneObj">
    {{迴圈的內容}}
</div>
var app = new Vue({
        el: "#app",
        data() {
          return {
            cloneObj:[1],
          };
        },
        filters: {},
        computed: {},
         mounted() {
          
        },
        methods: {
         addTravel(){
         
          this.cloneObj.push(1)
          }
        }
      });

 

相關文章