Getter named as "loading" not acceptable
See original GitHub issueI got myself losing tons of hours trying to track a bug in my app to discover that nuxt-property-decorator
does not accept a getter named “loading”.
<template>
<div>{{ loading }}</div>
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
@Component
export default class Playground extends Vue {
get loading() {
return 'loading...'
}
}
</script>
[Vue warn]: Property or method "loading" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
Steps to reproduce
yarn create nuxt-app my-nuxt-ts-app
leave default to all options except javascript/typescript part (select typescript)yarn add nuxt-property-decorator
- on
pages/index.vue:6
replace to{{ loading }}
- replace Vue.extend to a class component as above
yarn dev
Sandbox https://codesandbox.io/s/nuxt-property-decorator-loading-bug-orv7l?file=/pages/index.vue
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
using getter/setter does not allow use same name identifier as ...
it complains "duplicate identifier". I understand the identifier should be a private _CAT. The question here is why using getter/setter causes ...
Read more >Should a getter throw an exception if its object has invalid state?
If surname or name being null is a valid state for the object, then handle it accordingly. But if it's not a valid...
Read more >TypeError: setting getter-only property "x" - JavaScript | MDN
There is an attempt to set a new value to a property for which only a getter is specified. While this will be...
Read more >Getters and Setters: Manage Attributes in Python
These methods are commonly known as getter and setter methods. ... common in other programming languages, that's not the case in Python.
Read more >Effective Go - The Go Programming Language
The package name is only the default name for imports; it need not be unique across all ... Go doesn't provide automatic support...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You have to change your variable name to avoid this problem
I dont think this problem was caused by progress bar configuration because it is setted up in
nuxt.config.ts
, not in the component definition