Skip to content

antd.Slider的value参数类型声明不正确 #49

@PatZer0

Description

@PatZer0

官方example提供的代码:

import gradio as gr
import modelscope_studio.components.antd as antd
import modelscope_studio.components.base as ms

with gr.Blocks() as demo:
    with ms.Application():
        with antd.ConfigProvider():
            antd.Slider(value=50)
            antd.Slider(range=True, value=[20, 50])
            antd.Divider("Vertical")
            antd.Slider(range=True,
                        value=[20, 50],
                        step=5,
                        vertical=True,
                        elem_style=dict(height=200))
            antd.Divider("Customize tooltip")
            antd.Slider(tooltip=dict(formatter="(value) => `${value}%`"))

if __name__ == "__main__":
    demo.queue().launch()

其中用于预设值的value参数在按照example传入整数列表时提示类型错误,尝试将输入数组改为tuple会导致slider工作不正常,list[int]应该是正确的类型。

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions