We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<VIf condition={true}>
不能将类型“{ condition: boolean | undefined; }”分配给类型“{ props: any; }”。 类型“{ props: any; }”上不存在属性“condition”。ts(2322)
如果改成 (ctx)=><div>ctx.props.condition</div> 没问题 这种写法在非jsx中 注册到components中的时候控制台也会报类型错误,但不影响编译
(ctx)=><div>ctx.props.condition</div>
The text was updated successfully, but these errors were encountered:
能否提供可以运行的复现?没太懂你的问题
Sorry, something went wrong.
functional component name.tsx
export default ({props})=><div>props.value</div>
used.tex
import Name from './name' ... render () { return ( <div><Name value={this.fullname} /></div> ) } ...
这样Name 标签就会报类型错误:
Name
不能将类型“{ value: string | undefined; }”分配给类型“{ props: any; }”。 类型“{ props: any; }”上不存在属性“value”。ts(2322)
你需要给 props 加上类型声明,这是正常报错。
哦我知道了,你应该是碰上了这个问题 vuejs/vue-cli#2417 请使用 vue-tsx-support https://github.com/wonderful-panda/vue-tsx-support
No branches or pull requests
<VIf condition={true}>
如果改成
(ctx)=><div>ctx.props.condition</div>
没问题这种写法在非jsx中 注册到components中的时候控制台也会报类型错误,但不影响编译
The text was updated successfully, but these errors were encountered: