ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

使用jsx创建表单时,会报‘Invalid handler for event "input": got undefined’错误 。(When creating a form using jsx, it will report an error of ‘Invalid handler for event "input": got undefined’.) #20255

Open soandsoprogrammer opened 4 years ago

soandsoprogrammer commented 4 years ago
soandsoprogrammer commented 4 years ago

image image

wangxdmm commented 4 years ago

是 vModel..

soandsoprogrammer commented 4 years ago

是 vModel..

不是这个原因, v-model是可以用的 vue-cli是支持的。 最后排查出来是 el-form 标签需要加一个oninput事件,估计是源码中哪里用到了这个。但我不知道随便绑定个事件会有什么后果

lovewmf commented 3 years ago

是 vModel..

不是这个原因, v-model是可以用的 vue-cli是支持的。 最后排查出来是 el-form 标签需要加一个oninput事件,估计是源码中哪里用到了这个。但我不知道随便绑定个事件会有什么后果

解决了没

lovewmf commented 3 years ago

最终解决方案{..props:{}}


render(h){
        return(
            <div class="zysoft-table-select-meet-frame">
                <el-form ref="tableForm"
                    class="zysoft-form-serch"  
                    {...{props: {
                        model: this.formModel,////vue jsx element 表单校验的model不可以直接写 以这种方式解决
                        inline: this.inline, 
                        labelPosition:this.labelPosition,
                        disabled: this.isDisabled,
                        labelWidth: this.labelWidth,
                        size: this.size
                    } } }
                    >
                    <el-row gutter={20}>
                        { this.generateCode() }
                        { this.$slots.select } 
                    </el-row>
                </el-form>
            </div>
        )
    }
``
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.