Skip to content

Commit

Permalink
fix: allow accessing vue-router properties in property initializers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn committed Jul 20, 2020
1 parent 4c7f651 commit f02fa0e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ export function collectDataFromConstructor (vm: Vue, Component: VueClass<Vue>) {
}
}
keys.forEach(key => {
if (key.charAt(0) !== '_') {
Object.defineProperty(this, key, {
get: () => vm[key],
set: value => { vm[key] = value },
configurable: true
})
}
Object.defineProperty(this, key, {
get: () => vm[key],
set: value => { vm[key] = value },
configurable: true
})
})
}

Expand Down

0 comments on commit f02fa0e

Please sign in to comment.