vue-local-scope
vue-local-scope copied to clipboard
createLocalScope: accessing other computed properties
It would be nice if there is some way to access other computed properties in the first argument of createLocalScope. Right now, they are only accessible by this.computedName + '_'.
Here is a working example:
const myScope = createLocalScope({
posts: ({ data }) => data.results || [],
filteredPosts: ({ posts_ }) => posts_.filter(post => post.unread),
data: false
});
Maybe something like this would be nicer:
const myScope = createLocalScope({
posts: ({ data }) => data.results || [],
filteredPosts: (, { posts }) => posts.filter(post => post.unread),
data: false
});
Thank you :)