You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a SFC class component and include it into your app. Add methods mounted(), exportieren() and defaultWert():
<script lang="ts">
importVuefrom"vue";importComponentfrom"vue-class-component";@Component({})exportdefaultclassHelloWorldextendsVue { test =""; mounted() {console.log("mounted!");this.test="Hallo Welt!"; } exportieren():void {// do nothing } defaultWert():void {// do nothing }}
</script>
<template>
<p>{{ test }}</p>
</template>
What is expected?
exportieren() and defaultWert() should not prevent lifecycle hooks from being called.
What is actually happening?
Lifecycle hook mounted() is not called. Renaming/rearranging/removing either exportieren() or defaultWert() fixes the issue.
I'm guessing it's a problem with the sfc-compiler, as I can't reproduce this bug with a plain js/ts component:
importVuefrom"vue";importComponentfrom"vue-class-component";
@Component({template: "<p>{{ test }}</p>"})exportdefaultclassHelloWorldextendsVue{test="";mounted(){console.log("mounted!");this.test="Hallo Welt!";}exportieren(): void{// do nothing}defaultWert(): void{// do nothing}}
Version
2.7.14
Reproduction link
codesandbox.io
Steps to reproduce
mounted()
,exportieren()
anddefaultWert()
:What is expected?
exportieren()
anddefaultWert()
should not prevent lifecycle hooks from being called.What is actually happening?
Lifecycle hook
mounted()
is not called. Renaming/rearranging/removing eitherexportieren()
ordefaultWert()
fixes the issue.I'm guessing it's a problem with the sfc-compiler, as I can't reproduce this bug with a plain js/ts component:
I'm just spitballing but it might be a problem with https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/rewriteDefault.ts#L5. I pasted the regex into regexr: https://regexr.com/73ktb
The text was updated successfully, but these errors were encountered: