Skip to content

Commit 331e27d

Browse files
committed
fix ref context
1 parent 2c51c5c commit 331e27d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-facing-decorator",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"description": "Vue typescript class and decorator based component.",
55
"main": "dist/index.js",
66
"keywords": [

src/option/ref.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export function build(cons: Cons, optionBuilder: OptionBuilder) {
1414
if (names) {
1515
optionBuilder.beforeCreateCallbacks??=[]
1616
optionBuilder.beforeCreateCallbacks.push(function(this:any){
17-
17+
const ctx = this
1818
names.forEach((value, name) => {
1919

2020
Object.defineProperty(this,name,{
2121
get(this:any){
22-
return this.$refs[name]
22+
return ctx.$refs[name]
2323
}
2424
})
2525

0 commit comments

Comments
 (0)