账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    iview table 里button的loading属性如何配置
    38
    0

    render渲染的button这样添加loading属性,触发事件后所有的按钮都会是loading状态,有什么方法可以只让当前被点击的按钮loading吗?

    {
                            title: '操作',
                            key: 'action',
                            width: 150,
                            align: 'center',
                            render: (h, params) => {
                                return h('div', [
                                    h('Button', {
                                        props: {
                                            type: 'primary',
                                            size: 'small'
                                        },
                                        style: {
                                            marginRight: '5px'
                                        },
                                        on: {
                                            click: () => {
                                                this.edit(params.index, params.row)
                                            }
                                        }
                                    }, '编辑'),
                                    h('Button', {
                                        props: {
                                            type: 'error',
                                            size: 'small',
                                            loading: this.loading
                                        },
                                        on: {
                                            click: () => {
                                                this.remove(params.index, params.row)
                                            }
                                        }
                                    }, '删除')
                                ]);
                            }
                        }
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 似温柔亦苍白、 普通会员 1楼

      在iview的table组件中,我们可以通过设置loading属性来显示加载状态的按钮。以下是一个简单的示例:

      ```html

      ```

      在这个示例中,我们为submit方法添加了loading属性,当点击加载更多按钮时,这个属性会被设置为false,表示加载状态被切换为加载完成。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部