[feature request] Use data properties as defaults
See original GitHub issueI know that we can define defaults using the following syntax:
{
asyncComputed: {
item: {
get() {
// Do something asynchronous
},
default: [], // default value
},
},
};
But it would be great if we could use data
to define defaults as follows:
{
data: () => ({
item: [], // default value
}),
asyncComputed: {
item() {
// Do something asynchronous
},
},
};
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Feature Request: Allow generating an object with a full set of ...
The workflow we use is: Allocate an initial set of defaults in a nested object (note: this isn't fully filled in so won't...
Read more >Customizing Feature Request List Columns in Savio
By default, your feature request page is set up with the following columns: “Feature Request”, “Feedback”, “MRR”, “Status”, “Priority”, and “ ...
Read more >Add a Google Analytics 4 property (to a site that already has ...
Copies the property name, website URL, timezone, and currency settings ... To see historical data, use the reports in your Universal Analytics property....
Read more >Please make it possible to submit variable values via an URL
When embedding a Klip, one can set variables to get different default values while using the same Klip. When embedding a published Dashboard, ......
Read more >Query (Feature Service/Layer)—ArcGIS REST APIs
Query with returnDistinctResults defaults to using spatial relation ... Hosted feature services using a spatiotemporal data store do not currently 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
AsyncComputed is an enhancement (convenience implementation) of Vue’s computed. These are not defined as component data, but defined when they’re created. It follows that AsyncComputed should behave the same way. If one needs default values, use AsyncComputed’s own
default:
Computed
AsyncComputed
This is not really the vue way to do it.
Vue defines properties on the instance as sort of aliases of either pops, data or computed. So the vue way is what asyncComputed is doing currently: Add new properties to the instance (and not transform data properties). Currently, no conflict checking is done between async computed properties and data properties (but that should be done).