Browse Source

feat(step): add props iconColor

richard1015 4 years ago
parent
commit
a466fd11e5
2 changed files with 9 additions and 14 deletions
  1. 7 13
      src/packages/__VUE/step/index.vue
  2. 2 1
      src/packages/__VUE/steps/doc.md

+ 7 - 13
src/packages/__VUE/step/index.vue

@@ -2,12 +2,9 @@
   <view :class="classes">
     <view class="nut-step-head">
       <view class="nut-step-line"></view>
-      <view
-        class="nut-step-icon"
-        :class="[!dot ? (icon ? 'is-icon' : 'is-text') : '']"
-      >
+      <view class="nut-step-icon" :class="[!dot ? (icon ? 'is-icon' : 'is-text') : '']">
         <template v-if="icon">
-          <nut-icon class="nut-step-icon-inner" :name="icon" :size="size" />
+          <nut-icon class="nut-step-icon-inner" :color="iconColor" :name="icon" :size="size" />
         </template>
         <template v-else-if="dot"></template>
         <template v-else>
@@ -25,14 +22,7 @@
 </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');
 
@@ -50,6 +40,10 @@ export default create({
       type: String,
       default: null
     },
+    iconColor: {
+      type: String,
+      default: ''
+    },
     size: {
       type: [String, Number],
       default: '12px'

+ 2 - 1
src/packages/__VUE/steps/doc.md

@@ -91,4 +91,5 @@ app.use(Step);
 | ---------------- | ---------------------- | ------------ | ----------- |
 | title            | 流程步骤的标题         | String | 步骤 |
 | content          | 流程步骤的描述性文字(支持 html 结构)       | String | 步骤描述 |
-| icon          | 图标       | String | null |
+| icon          | 图标       | String | null |
+| icon-color          | 图标颜色       | String | null |