Ant-design-vue: template中使用form表单的问题

Created on 18 Dec 2018  ·  6Comments  ·  Source: vueComponent/ant-design-vue

1.使用antd-vue表单,通过this.$form.createForm(this)注册form时,提示createForm方法不存在
2.v-decorate指令识别不了

vue.runtime.esm.js?2b0e:587 [Vue warn]: Error in data(): "TypeError: Cannot read property 'createForm' of undefined"

found in

outdated

All 6 comments

@tangjinzhou 同样的问题

@cschensai

import Form from 'ant-design-vue/lib/form'

export default {
   beforeCreate () {
    this.form = Form.createForm(this)
  }
}

1.使用antd-vue表单,通过this.$form.createForm(this)注册form时,提示createForm方法不存在
2.v-decorate指令识别不了

vue.runtime.esm.js?2b0e:587 [Vue warn]: Error in data(): "TypeError: Cannot read property 'createForm' of undefined"

found in

[Vue warn]: Failed to resolve directive: decorator

我也遇到了这个问题,你是怎么解决的,可以说一下么

1.使用antd-vue表单,通过this.$form.createForm(this)注册form时,提示createForm方法不存在
2.v-decorate指令识别不了
vue.runtime.esm.js?2b0e:587 [Vue warn]: Error in data(): "TypeError: Cannot read property 'createForm' of undefined"
found in
[Vue warn]: Failed to resolve directive: decorator

我也遇到了这个问题,你是怎么解决的,可以说一下么

不要绑定在vue实例上,按需引入,然后按照我上面的方法创建即可

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings