Skip to content

Commit f02fa0e

Browse files
authored
fix: allow accessing vue-router properties in property initializers (#434)
1 parent 4c7f651 commit f02fa0e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/data.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ export function collectDataFromConstructor (vm: Vue, Component: VueClass<Vue>) {
1717
}
1818
}
1919
keys.forEach(key => {
20-
if (key.charAt(0) !== '_') {
21-
Object.defineProperty(this, key, {
22-
get: () => vm[key],
23-
set: value => { vm[key] = value },
24-
configurable: true
25-
})
26-
}
20+
Object.defineProperty(this, key, {
21+
get: () => vm[key],
22+
set: value => { vm[key] = value },
23+
configurable: true
24+
})
2725
})
2826
}
2927

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy