Blame view

admin-web-master/src/views/aaa/components/toolBar/toolModule/tool-select.vue 1.14 KB
3f535f30   杨鑫   '初始'
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
44
45
46
47
48
49
50
51
52
53
54
55
56
  <template>
    <div class="module-box link-select">
      <div class="module-box__title">
        <label class="module-box__label">{{title}}</label>
      </div>
      <el-select class="link-select__select" :popper-append-to-body="false" v-model="selsectValue" placeholder="请选择跳转到的页面" @change="selectChanged">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
    </div>
  </template>
  
  <script>
    export default {
      name: 'tool-select',
      data () {
        return {
          selsectValue: ''
        }
      },
      props: {
        title: {
          type: String,
          default: '标题'
        },
        linkValue: {
          type: String,
          default: ''
        },
        options: {
          type: Array,
          default: () => []
        }
      },
      mounted () {
        this.selsectValue = this.linkValue // props 不能直接修改
      },
      methods: {
        selectChanged (value) {
          this.$emit('update:linkValue', value)
        }
      }
    }
  </script>
  
  <style lang="scss" scoped>
    .link-select{
      &__select{
       width: 100%;
      }
    }
  </style>