如何更改 ipyvuetify 中范围滑块拇指中的值显示?
How to change the value display in the thumb of a range slider in ipyvuetify?
在 vuetify 文档中如下 example
<v-slider
v-model="slider"
:thumb-size="24"
thumb-label="always"
>
<template v-slot:thumb-label="{ value }">
{{ satisfactionEmojis[Math.min(Math.floor(value / 10), 9)] }}
</template>
</v-slider>
并且我尽力让它适应ipyvuetify
:
toto = v.Slider(
v_model=None,
thumb_label = True,
class_='mt-5',
v_slots = [{
'name': 'thumb_label',
'variable': 'thumb.value',
'children': 'toto'
}]
)
toto
但我的滑块一直显示数字而不是“toto”。我错过了什么 ?有可能吗?
这里的问题是您将 v_slot
名称称为 thumb_label
,但插槽名称确实是 thumb-label
。
toto = v.Slider(
v_model=None,
thumb_label = True,
class_='mt-5',
v_slots = [{
'name': 'thumb-label',
'variable': 'thumb.value',
'children': 'toto'
}]
)
toto
在 vuetify 文档中如下 example
<v-slider
v-model="slider"
:thumb-size="24"
thumb-label="always"
>
<template v-slot:thumb-label="{ value }">
{{ satisfactionEmojis[Math.min(Math.floor(value / 10), 9)] }}
</template>
</v-slider>
并且我尽力让它适应ipyvuetify
:
toto = v.Slider(
v_model=None,
thumb_label = True,
class_='mt-5',
v_slots = [{
'name': 'thumb_label',
'variable': 'thumb.value',
'children': 'toto'
}]
)
toto
但我的滑块一直显示数字而不是“toto”。我错过了什么 ?有可能吗?
这里的问题是您将 v_slot
名称称为 thumb_label
,但插槽名称确实是 thumb-label
。
toto = v.Slider(
v_model=None,
thumb_label = True,
class_='mt-5',
v_slots = [{
'name': 'thumb-label',
'variable': 'thumb.value',
'children': 'toto'
}]
)
toto