fix: refhooks
parent
6f903c3a75
commit
7661eafe9c
|
@ -1,10 +1,10 @@
|
|||
const createRefHooks = fn => {
|
||||
return {
|
||||
onVnodeBeforeMount: vnode => {
|
||||
fn(vnode.component || vnode.el, vnode.key);
|
||||
fn((vnode.component && vnode.component.ctx) || vnode.el, vnode.key);
|
||||
},
|
||||
onVnodeUpdated: vnode => {
|
||||
fn(vnode.component || vnode.el, vnode.key);
|
||||
fn((vnode.component && vnode.component.ctx) || vnode.el, vnode.key);
|
||||
},
|
||||
onVnodeUnmounted: vnode => {
|
||||
fn(null, vnode.key);
|
||||
|
|
|
@ -32,10 +32,10 @@ const Switch = {
|
|||
},
|
||||
methods: {
|
||||
focus() {
|
||||
this.refSwitchNode?.ctx?.focus();
|
||||
this.refSwitchNode?.focus();
|
||||
},
|
||||
blur() {
|
||||
this.refSwitchNode?.ctx?.blur();
|
||||
this.refSwitchNode?.blur();
|
||||
},
|
||||
saveRef(c) {
|
||||
this.refSwitchNode = c;
|
||||
|
|
Loading…
Reference in New Issue