DrissionPage/docs/APIs/Select 类.md
2021-12-10 19:02:42 +08:00

79 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## class Select()
Select 类专门用于处理 d 模式下 select 标签。
参数说明:
- ele: select 元素对象
## is_multi
返回:是否多选列表
## options
返回所有被选中的option元素列表
## selected_option
返回第一个被选中的option元素
## selected_options
返回所有被选中的option元素列表
## clear()
清除所有已选项。
## select()
选定或取消选定下拉列表中子元素。
参数说明:
- text_value_index根据文本、值选或序号择选项若允许多选传入list或tuple可多选
- para_type参数类型可选 'text'、'value'、'index'
- deselect是否取消选择
返回:是否选择成功
## select_multi()
选定或取消选定下拉列表中多个子元素。
参数说明:
- text_value_index根据文本、值选或序号择选多项
- para_type参数类型可选 'text'、'value'、'index'
- deselect是否取消选择
返回:是否选择成功
## deselect()
选定或取消选定下拉列表中子元素。
参数说明:
- text_value_index根据文本、值选或序号取消择选项若允许多选传入list或tuple可多选
- para_type参数类型可选 'text'、'value'、'index'
返回:是否选择成功
## deselect_multi()
选定或取消选定下拉列表中多个子元素。
参数说明:
- text_value_index根据文本、值选或序号取消择选多项
- para_type参数类型可选 'text'、'value'、'index'
返回:是否选择成功
## invert()
反选。