vue-local-scope icon indicating copy to clipboard operation
vue-local-scope copied to clipboard

createLocalScope: accessing other computed properties

Open Tinoooo opened this issue 6 years ago • 0 comments

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 :)

Tinoooo avatar Sep 05 '19 09:09 Tinoooo