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
子组件Comp1:
<script setup lang="ts"> import { ref } from 'vue' defineProps<{msg: string, show: boolean}>() </script> <template> <h1 v-if="show">{{ msg }}</h1> </template>
子组件Comp2:
<script setup lang="ts"> import { ref } from 'vue' defineProps({ msg: String, show: Boolean }) </script> <template> <h1 v-if="show">{{ msg }}</h1> </template>
父组件: show 属性都是用了简写
show
<script setup lang="ts"> import Comp1 from './components/Comp1.vue' import Comp2 from './components/Comp2.vue' </script> <template> <img alt="Vue logo" src="./assets/logo.png" /> <Comp1 msg="ts泛型定义Props显示了" show /> <Comp2 msg="js定义Props显示了" show /> </template> <style> #app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px; } </style>
这两种方式在开发模式下时正常的,vite打包之后Comp1 不会显示,Comp2显示,是用的vite官网新建的项目测试的
https://github.com/npmrun/vue-ts-props
System: OS: Windows 10 10.0.19042 CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz Memory: 1.39 GB / 7.83 GB Binaries: Node: 14.15.3 - C:\Program Files\nodejs\node.EXE npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.906.0), Chromium (95.0.1020.40) Internet Explorer: 11.0.19041.1
npm
没有报错
The text was updated successfully, but these errors were encountered:
Bug in @vue/compiler-sfc. Fixed by vuejs/core#4790
@vue/compiler-sfc
Please wait for the next patch release.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
子组件Comp1:
子组件Comp2:
父组件:
show
属性都是用了简写这两种方式在开发模式下时正常的,vite打包之后Comp1 不会显示,Comp2显示,是用的vite官网新建的项目测试的
Reproduction
https://github.com/npmrun/vue-ts-props
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: