浏览代码

fix: steps getCurrentInstance proxy

suzigang 4 年之前
父节点
当前提交
9c3e08b41a
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/packages/step/index.vue

+ 3 - 3
src/packages/step/index.vue

@@ -53,15 +53,15 @@ export default create({
   },
 
   setup(props, { emit, slots }) {
-    const instance = getCurrentInstance() as ComponentInternalInstance;
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
     const parent: any = inject('parent');
-    parent['relation'](instance);
+    parent['relation'](proxy);
 
     const state = reactive({
       dot: parent.props.progressDot
     });
 
-    const index = computed(() => parent.state.children.indexOf(instance) + 1);
+    const index = computed(() => parent.state.children.indexOf(proxy) + 1);
 
     const getCurrentStatus = () => {
       const activeIndex = index.value;