CycList.vue 1.07 KB
Newer Older
liuxin committed
1 2
<template>
<div>
潘际乾 committed
3 4
  <c-row class="m-swf-message-content-item">
    <c-col :span="1">
liuxin committed
5
      <i class="el-icon-circle-plus-outline" @click="handleAdd"></i>
潘际乾 committed
6 7
    </c-col>
    <c-col :span="3">
liuxin committed
8
      {{"---->"}}
潘际乾 committed
9 10
    </c-col>
  </c-row>
liuxin committed
11 12 13 14 15 16 17
  <div v-for="(item, index) in pattern.cycs" :key="index">
    <message-area :pattern="item" v-bind="$attrs">
      <template v-slot:icon>
        <i v-if="index !== 0" class="el-icon-circle-close" @click="handleDelete(index)"></i>
      </template>
    </message-area>
  </div>
潘际乾 committed
18 19
  <c-row class="m-swf-message-content-item">
    <c-col :span="1">
liuxin committed
20
      {{''}}
潘际乾 committed
21 22
    </c-col>
    <c-col :span="3">
liuxin committed
23
      {{"----|"}}
潘际乾 committed
24 25
    </c-col>
  </c-row>
liuxin committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
</div>
</template>
<script>

export default {
  name: 'cyc-list',
  props: {
    pattern: {
      type: Object,
      default: () => {}
    }
  },
  data: function () {
    return {}
  },
  methods: {
    handleAdd: function () {
      console.log(this.pattern.pattern)
      this.pattern.cycs.push(this.pattern.pattern)
    },
    handleDelete: function (index) {
      this.pattern.cycs.splice(index, 1)
    }
  }
}
</script>