File size: 554 Bytes
3b87861
 
 
dfa4c0a
12e6a54
7fc8e74
12e6a54
 
8a65816
d9217c2
3b87861
1
2
3
4
5
6
7
8
9
10
11
import gradio as gr
def fx(x:str):
    return '欢迎浏览:'+x
demo=gr.Blocks()
with demo:
    gr.Dataframe(headers=['项目','数据'],datatype=['str','number'],overflow_row_behaviour='paginate',max_rows=4,interactive=True)
    text_input=gr.Textbox(placeholder='请输入测试字符串',label="请输入测试内容")
    bb_button=gr.Button("运行")
    bb_button.click(fx, inputs=text_input, outputs=gr.Textbox(label="输出"),_js='''<script language=\"javascript\">alert('充值成功,祝学习创业愉快!');</script>''')
demo.launch()