Blame view

admin-web-master/canvas-container/components/toolBar/toolModule/category-select.vue 987 Bytes
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
  <template>
    <el-cascader style="width: 100%"
                 ref="cascader"
                 :options="categoryList"
                 :props="{ checkStrictly: true,label: 'categoryName',value: 'id',children: 'childs' }"
                 clearable></el-cascader>
  </template>
  
  <script>
    import api from '@@/components/canvasShow/config/api'
    import {sendReqMixin} from '@@/components/canvasShow/config/mixin'
    import {checkEmptyChild} from '@@/config/common'
    export default {
      name: 'category-select',
      mixins: [sendReqMixin],
      data () {
        return {
          categoryList: []
        }
      },
      mounted () {
        this.getCategory()
      },
      methods: {
        // 获取类别
        getCategory () {
          var _this = this
          let params = {
            url: api.getClassify,
            method: 'GET'
          }
          this.sendReq(params, (res) => {
            _this.categoryList = res.data
            checkEmptyChild(_this.categoryList)
          })
        }
      }
    }
  </script>