-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Closed
Description
Vue version
3.2.45
Link to minimal reproduction
https://github.com/Lyon1994/vue-issues-project/tree/issues-001
Steps to reproduce
cd ${PROJECT_DIR}
pnpm i
pnpm devOpen Browser, then you can find 'undefined' in web page
What is expected?
HelloWorld.tsx can get valid props from parent component.
Do not display 'undefined'
What is actually happening?
HelloWorld.tsx can not get valid props from parent component.
It display 'undefined'
System Info
System:
OS: Linux 5.15 Deepin 20.7.1 20.7.1
CPU: (8) x64 Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
Memory: 3.74 GB / 15.52 GB
Container: Yes
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 16.17.0 - /usr/local/bin/node
Yarn: 1.22.17 - ~/.local/bin/yarn
npm: 8.13.2 - ~/.local/bin/npmAny additional comments?
HelloWorld Component:
export interface HelloWorldProps {
msg: string;
}
export default defineComponent<HelloWorldProps>((props) => {
const msg = ref(props.msg);
if (!props.msg) {
console.error(
`Can not get props from defineComponent function in tsx file: props.msg=${props.msg}`
);
}
return () => (
<div>
<h1>
HelloWorld.tsx get props.msg {" => "}
<span style="color:red;">{props.msg ?? msg.value ?? "undefined"}</span>
</h1>
</div>
);
});Metadata
Metadata
Assignees
Labels
No labels
