想问一下 这个树形结构里面如果没数据的时候的提示语咋改啊 为啥显示这个 全局搜了也没有

img

img


想问一下 这个树形结构里面如果没数据的时候的提示语咋改啊 为啥显示这个 全局搜了也没有

img

查到这个是一个第三发组件,这是文档 https://www.vue-treeselect.cn/#basic-features


noChildrenText    Type: String     Default: "No sub-options."    当分支节点没有子节点时显示的文本。

noOptionsText    Type: String     Default: "No options available."    没有可用选项时显示的文本。

noResultsText    Type: String     Default: "No results found..."    没有匹配的搜索结果时显示的文本。

img

如下代码


<el-form-item label="归属部门" prop="dept_id">
              <el-select
                v-model="dept_name"
                ref="selectTree"
                placeholder="请选择部门"
              >
                <el-option style="height: auto" :value="dept_name">
                  <el-tree
                    :data="deptList"
                    highlight-current
                    node-key="dept_id"
                    ref="tree"
                    :props="deptProps"
                    @node-click="clickNodeDept"
                  ></el-tree>
                </el-option>
              </el-select>
            </el-form-item>


deptList: [],
        deptListProps: {
          value: "dept_id",
          label: "dept_name",
          children: "children",
        },


clickNodeDept(data) {
        this.dept_name = data.dept_name;
        this.sysUser.dept_id = data.dept_id;
        this.$refs.selectTree.blur();
      },