ipyvuetify 在 select 对象中添加事件图标
ipyvuetify add event icon in select object
我想link参加这个活动,如果你点击图标,你有什么想法吗?因为如果用户单击删除图标,我想清除 Select 中选择的所有值,也许我们有另一种方法可以做到这一点。
import ipyvuetify as v
model_select =v.Select(
color = 'blue',
append_outer_icon='delete',
style_='width: 600px',
v_model= None,
items=['Select All',
'A',
'B',
'C',
'D'
],
item_color = 'blue',
label='Hospital Name',
attach = False,
solo = True,
small_chips = True,
multiple = True,
deletable_chips = True,
autofocus = True,
)
def on_click(widget, event, data):
print(model_select.v_model)
if 'Select All' in model_select.v_model:
model_select.v_model = set(model_select.items) - set(['Select All'])
model_select.on_event('change', on_click)
model_select.append_outer_icon
model_select
点击删除图标可以用click:append-outer
事件处理。请参阅 https://v2.vuetifyjs.com/en/components/selects/
上 'API' 下的 'Events'
我想link参加这个活动,如果你点击图标,你有什么想法吗?因为如果用户单击删除图标,我想清除 Select 中选择的所有值,也许我们有另一种方法可以做到这一点。
import ipyvuetify as v
model_select =v.Select(
color = 'blue',
append_outer_icon='delete',
style_='width: 600px',
v_model= None,
items=['Select All',
'A',
'B',
'C',
'D'
],
item_color = 'blue',
label='Hospital Name',
attach = False,
solo = True,
small_chips = True,
multiple = True,
deletable_chips = True,
autofocus = True,
)
def on_click(widget, event, data):
print(model_select.v_model)
if 'Select All' in model_select.v_model:
model_select.v_model = set(model_select.items) - set(['Select All'])
model_select.on_event('change', on_click)
model_select.append_outer_icon
model_select
点击删除图标可以用click:append-outer
事件处理。请参阅 https://v2.vuetifyjs.com/en/components/selects/