diff --git a/packages/steps/README.md b/packages/steps/README.md index 4dfd3771..517d6ffe 100644 --- a/packages/steps/README.md +++ b/packages/steps/README.md @@ -70,10 +70,3 @@ Page({ | 类名 | 说明 | |-----------|-----------| | custom-class | 根节点样式类 | - -### 更新日志 - -| 版本 | 类型 | 内容 | -|-----------|-----------|-----------| -| 0.0.1 | feature | 新增组件 | -| 0.3.4 | bugfix | 修复样式错误的问题 | diff --git a/packages/steps/index.less b/packages/steps/index.less index 0c043bd2..ebb3df45 100644 --- a/packages/steps/index.less +++ b/packages/steps/index.less @@ -36,8 +36,8 @@ &__circle { width: 5px; height: 5px; - border-radius: 50%; background-color: @gray-dark; + border-radius: 50%; } &--horizontal { @@ -60,8 +60,8 @@ width: auto; .van-step__title { - transform: none; text-align: right; + transform: none; } .van-step__circle-container { @@ -88,9 +88,9 @@ .van-step__line { position: absolute; - left: 0; right: 0; bottom: 6px; + left: 0; height: 1px; background-color: @border-color; transform: translate3d(0, 50%, 0); @@ -102,16 +102,15 @@ .van-step__active { display: block; font-size: 12px; - color: @green; line-height: 1; } } } &--vertical { + padding: 10px 10px 10px 0; font-size: 14px; line-height: 18px; - padding: 10px 10px 10px 0; &::after { border-bottom-width: 1px; @@ -123,14 +122,14 @@ &:first-child { &::before { - content: ''; position: absolute; - width: 1px; - height: 20px; - background-color: @white; top: 0; left: -15px; z-index: 1; + width: 1px; + height: 20px; + background-color: @white; + content: ''; } } diff --git a/packages/steps/index.ts b/packages/steps/index.ts index 1a710917..3152bc8c 100644 --- a/packages/steps/index.ts +++ b/packages/steps/index.ts @@ -14,36 +14,5 @@ VantComponent({ type: String, value: GREEN } - }, - - watch: { - steps: 'formatSteps', - active: 'formatSteps' - }, - - created() { - this.formatSteps(); - }, - - methods: { - formatSteps() { - const { steps } = this.data; - steps.forEach((step, index) => { - step.status = this.getStatus(index); - }); - this.set({ steps }); - }, - - getStatus(index) { - const { active } = this.data; - - if (index < active) { - return 'finish'; - } else if (index === active) { - return 'process'; - } - - return ''; - } } }); diff --git a/packages/steps/index.wxml b/packages/steps/index.wxml index b323233e..508705d6 100644 --- a/packages/steps/index.wxml +++ b/packages/steps/index.wxml @@ -1,20 +1,35 @@ - + + + - + {{ item.text }} {{ item.desc }} - + - + + + +function get(index, active) { + if (index < active) { + return 'finish'; + } else if (index === active) { + return 'process'; + } + + return ''; +} + +module.exports = get; +