el-cascader 数据的回显

                    <el-cascader
                        placeholder="试试搜索"
                        :options="allOptions"
                        :props="{ multiple: true }"
                        v-model="options"
                        filterable 
                        style="width: 80%;max-height:240px;overflow-y:scroll;">
                    </el-cascader>

allOptions里面包含了所有你要选择的值 

allOptions: [{
              value: '1',
              label: '一致'
            }, {
              value: '2',
              label: '反馈'
            }, {
              value: '3',
              label: '效率'
            }, {
              value: '4',
              label: '可控4'
            }, {
              value: '5',
              label: '可控5'
            }, {
              value: '6',
              label: '可控6'
            }, {
              value: '7',
              label: '可控7'
            }, {
              value: '8',
              label: '可控8'
            }, {
              value: '9',
              label: '可控9'
            }, {
              value: '0',
              label: '可控0'
            }]

 options:['0','2','4','6']

如果 multiple: true  则 options 是数组

如果没有该属性 则 options: 0

options 中的数据 在allOptions 中必须存在才可以查出

猜你喜欢

转载自blog.csdn.net/xss12322/article/details/131962264