Element UI级联选择器报错"TypeError: Cannot read property 'getElementsByClassName' of undefined"

点击的时候第一层出现了但是点击指南或者资源的时候,他就报错Cannot read property 'getElementsByClassName' of undefined

<el-cascader
                      :options="options2"
                      @change="handleItemChange"
                      v-model="filters.chapterid"
                      :props="props"
                      :show-all-levels="false"
                      placeholder="知识点"
                    ></el-cascader>

data里面定义:

 options2: [],
                    props: {
                      label: 'label',
                      children: 'children'
                    },

看官网例子是

我们之间的差别是我用的id存的value的值。

所以我在data里面要定义指定我的value在哪里

修改data里面的 props: {
                      value: 'id',
                      children: 'children'
                    },

猜你喜欢

转载自blog.csdn.net/qq_33769914/article/details/82351648