treeselect 配置
时间: 2023-09-03 13:13:56 浏览: 98
treeselect的配置可以通过引入并注册Treeselect组件来实现。首先,需要在页面中引入并注册Treeselect组件,代码如下:
```javascript
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
```
接下来,可以使用Treeselect组件进行查询并返回所有信息。例如,可以使用以下代码查询并返回所有信息:
```html
<select id="findAll" resultMap="DbConfigResult">
<include refid="selectDbConfigVo"/>
</select>
```
如果希望控制父子节点的显示,可以配置showCheckedStrategy属性。例如,可以使用以下代码配置showCheckedStrategy属性为SHOW_ALL,即显示父子节点:
```javascript
const Welcome = () => {
const \[value, setValue\] = useState(\['0-0-0'\]);
const tProps = {
treeData,
value,
treeCheckable: true,
showCheckedStrategy: TreeSelect.SHOW_ALL,
};
return <TreeSelect {...tProps} />;
};
```
以上是treeselect的配置方法。
#### 引用[.reference_title]
- *1* *2* [vue-treeselect使用](https://blog.csdn.net/u013008898/article/details/127241945)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [antdesign的树形下拉TreeSelect选择回显父节点/子节点/父子节点](https://blog.csdn.net/Sylvasylva/article/details/124999936)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文