0

如果您单击该图标,我想链接到该活动,您有什么想法吗?因为如果用户单击删除图标我想清除选择中选择的所有值,也许我们有另一种方法可以做到这一点。

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
4

1 回答 1

1

可以使用click:append-outer事件处理对删除图标的单击。请参阅https://v2.vuetifyjs.com/en/components/selects/上“API”下的“事件”

于 2021-08-26T13:24:53.663 回答