-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
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
(TypeScript) Property 'msg' has no initializer and is not definitely assigned in the constructor. #834
Comments
无法重现,可能是你的 npm 缓存问题。看下你的 export default class HelloWorld extends Vue {
@Prop() private msg!: string;
} |
The issue is most likely related to the If you're using TS 2.7, try to turn it off by adding a For a detailed explanation of the issue and some possible workarounds/fixes, read this post. |
Hi, I know that it is a bad habit to comment on closed issues, but what @Darkseal posted is just a workaround. Will the generate support strict property initialization in the future? |
remove "strict": true, |
@adminparry no why to remove strict? Whats the point of using type system then? As even said using bang to tell typesystem the value is initialized is good choice . Removing strict can allow other bugs thats why i never recommend it. |
Version
3.0.0-alpha.12
Steps to reproduce
vue create hello-world
使用 TypeScript 和使用 class-style 风格组件cd hello-world
yarn serve
oryarn build
What is expected?
Success
What is actually happening?
提示:
没有修改任何文件,创建默认项目后运行报错。
The text was updated successfully, but these errors were encountered: