Blame view

src/views/components-demo/drag-select.vue 1009 Bytes
d7d9c38c2   Adam   auto commit the c...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  <template>
    <div class="components-container">
      <el-drag-select v-model="value" style="width:500px;" multiple placeholder="请选择">
        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
      </el-drag-select>
  
      <div style="margin-top:30px;">
        <el-tag v-for="item of value" :key="item" style="margin-right:15px;">
          {{ item }}
        </el-tag>
      </div>
    </div>
  </template>
  
  <script>
  import ElDragSelect from '@/components/DragSelect' // base on element-ui
  
  export default {
    name: 'DragSelectDemo',
    components: { ElDragSelect },
    data() {
      return {
        value: ['Apple', 'Banana', 'Orange'],
        options: [{
          value: 'Apple',
          label: 'Apple'
        }, {
          value: 'Banana',
          label: 'Banana'
        }, {
          value: 'Orange',
          label: 'Orange'
        }, {
          value: 'Pear',
          label: 'Pear'
        }, {
          value: 'Strawberry',
          label: 'Strawberry'
        }]
      }
    }
  }
  </script>