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
Please describe what the rule should do:
The rule should warn when trying to set a writable computed ref nested property.
What category should the rule belong to?
Enforces code style (layout)
Warns about a potential error (problem)
Suggests an alternate way of doing something (suggestion)
Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
importVuefrom'vue'import{defineComponent,ref,computed}from'@vue/composition-api'exportdefaultdefineComponent({setup(props,{ root }){constvalue=ref('French')constlanguage=computed({get(){return{selected: value.value}},set({ selected }){value.value=selected}})console.log(value)// Frenchconsole.log(language)// { selected: 'French' }// Goodlanguage.value={selected: 'English'}// Bad, it has no effect unlike a standard reflanguage.value.selected='German'return{
language
}})}
Additional context
With writable computed ref, it's easy to fall into this case since IDE suggestion will show nested properties.
The text was updated successfully, but these errors were encountered:
Please describe what the rule should do:
The rule should warn when trying to set a writable computed ref nested property.
What category should the rule belong to?
Provide 2-3 code examples that this rule should warn about:
Additional context
With writable computed ref, it's easy to fall into this case since IDE suggestion will show nested properties.
The text was updated successfully, but these errors were encountered: