Skip to content

!(fieldOption && initialValue in fieldOption) 这段代码语法有误 #1291

@yicheng-irun

Description

@yicheng-irun
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

undefined

Environment

2

Reproduction link

https://vue.ant.design/components/form-cn/#components-form-demo-customized-form-controls

Steps to reproduce

这里不需要纠结于怎么复现,这里是纯粹的语法问题,因为一个报错,然后读源码然后发现这里写错了

What is expected?

把initialValue 用引号引起来就可以了

What is actually happening?

我在v-decorator中写了initialValue,依然会报错, [Vue warn]: Error in render: "ReferenceError: initialValue is not defined"


这里不重要,在/components/vc-form/src/createBaseForm.jsx 第207行
原写法:!(fieldOption && initialValue in fieldOption)
应该写成 !(fieldOption && 'initialValue' in fieldOption)

这里会报错 [Vue warn]: Error in render: "ReferenceError: initialValue is not defined"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions