浏览代码

Merge branch 'next' of https://github.com/jdf2e/nutui into next

richard1015 4 年之前
父节点
当前提交
bc5177d8f2
共有 2 个文件被更改,包括 16 次插入16 次删除
  1. 12 6
      src/packages/step/index.vue
  2. 4 10
      src/packages/steps/index.vue

+ 12 - 6
src/packages/step/index.vue

@@ -19,14 +19,20 @@
       <view class="nut-step-title">
         {{ title }}
       </view>
-      <view class="nut-step-content" v-html="content">
-      </view>
+      <view class="nut-step-content" v-html="content"> </view>
     </view>
   </view>
 </template>
 
 <script lang="ts">
-import { reactive, computed, inject, toRefs, getCurrentInstance, ComponentInternalInstance } from 'vue';
+import {
+  reactive,
+  computed,
+  inject,
+  toRefs,
+  getCurrentInstance,
+  ComponentInternalInstance
+} from 'vue';
 import { createComponent } from '@/utils/create';
 const { create, componentName } = createComponent('step');
 
@@ -46,7 +52,7 @@ export default create({
     }
   },
 
-  setup(props, {emit, slots}) {
+  setup(props, { emit, slots }) {
     const instance = getCurrentInstance() as ComponentInternalInstance;
     const parent: any = inject('parent');
     parent['relation'](instance);
@@ -59,7 +65,7 @@ export default create({
 
     const getCurrentStatus = () => {
       const activeIndex = index.value;
-      if(activeIndex < +parent.props.current) return 'finish';
+      if (activeIndex < +parent.props.current) return 'finish';
       return activeIndex === +parent.props.current ? 'process' : 'wait';
     };
 
@@ -84,6 +90,6 @@ export default create({
 });
 </script>
 
-<style scoped lang="scss">
+<style lang="scss">
 @import 'index.scss';
 </style>

+ 4 - 10
src/packages/steps/index.vue

@@ -1,11 +1,5 @@
 <script lang="ts">
-import {
-  provide,
-  computed,
-  reactive,
-  h,
-  ComponentInternalInstance
-} from 'vue';
+import { provide, computed, reactive, h, ComponentInternalInstance } from 'vue';
 import Step from '@/packages/step/index.vue';
 import { createComponent } from '@/utils/create';
 const { create, componentName } = createComponent('steps');
@@ -57,12 +51,12 @@ export default create({
           class: classes.value
         },
         slots.default?.()
-      )
-    }
+      );
+    };
   }
 });
 </script>
 
-<style scoped lang="scss">
+<style lang="scss">
 @import 'index.scss';
 </style>