+
{{ pack.showLabel }}
-
-
-
success
+
+
+
success
+
+
+
-
{{ pack.circle }}
-
-
{{ pack.size }}
-
-
-
-
-
+
{{ pack.circle }}
+
-
-
{{ pack.style }}
-
-
-
-
-
+
{{ pack.hideTrack }}
+
+
diff --git a/packages/varlet-ui/src/row/props.ts b/packages/varlet-ui/src/row/props.ts
index 3d812633de2..c9994efbb07 100644
--- a/packages/varlet-ui/src/row/props.ts
+++ b/packages/varlet-ui/src/row/props.ts
@@ -1,35 +1,29 @@
import { PropType } from 'vue'
function justifyValidator(justify: string) {
- return [
- 'flex-start',
- 'flex-end',
- 'center',
- 'space-between',
- 'space-around'
- ].includes(justify)
+ return ['flex-start', 'flex-end', 'center', 'space-between', 'space-around'].includes(justify)
}
function alignValidator(align: string) {
- return ['flex-start', 'flex-center', 'flex-end'].includes(align)
+ return ['flex-start', 'center', 'flex-end'].includes(align)
}
export const props = {
gutter: {
type: [String, Number],
- default: 0
+ default: 0,
},
justify: {
- type: String,
+ type: String as PropType<'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around'>,
default: 'flex-start',
- validator: justifyValidator
+ validator: justifyValidator,
},
align: {
- type: String,
+ type: String as PropType<'flex-start' | 'center' | 'flex-end'>,
default: 'flex-start',
- validator: alignValidator
+ validator: alignValidator,
},
onClick: {
- type: Function as PropType<(e: Event) => void>
- }
+ type: Function as PropType<(e: Event) => void>,
+ },
}
diff --git a/packages/varlet-ui/src/select/props.ts b/packages/varlet-ui/src/select/props.ts
index 340cc32e690..88b4701a317 100644
--- a/packages/varlet-ui/src/select/props.ts
+++ b/packages/varlet-ui/src/select/props.ts
@@ -55,7 +55,7 @@ export const props = {
default: ',',
},
textAlign: {
- type: String,
+ type: String as PropType<'left' | 'right' | 'center'>,
default: 'left',
validator: textAlignValidator,
},
diff --git a/packages/varlet-ui/src/slider/Slider.vue b/packages/varlet-ui/src/slider/Slider.vue
index 5684f36124c..9a6f254ceff 100644
--- a/packages/varlet-ui/src/slider/Slider.vue
+++ b/packages/varlet-ui/src/slider/Slider.vue
@@ -106,7 +106,6 @@
diff --git a/packages/varlet-ui/src/slider/slider.less b/packages/varlet-ui/src/slider/slider.less
index 71ad9e0b1b8..1e6057ed615 100644
--- a/packages/varlet-ui/src/slider/slider.less
+++ b/packages/varlet-ui/src/slider/slider.less
@@ -125,6 +125,6 @@
}
&__form[var-slider-cover] {
- margin: 0 0 0 6px;
+ margin: 0;
}
}
diff --git a/packages/varlet-ui/src/steps/docs/en-US.md b/packages/varlet-ui/src/steps/docs/en-US.md
index d356df1965d..08d527d1b65 100644
--- a/packages/varlet-ui/src/steps/docs/en-US.md
+++ b/packages/varlet-ui/src/steps/docs/en-US.md
@@ -24,7 +24,7 @@ Use `active` prop to control the progress of step, value is index of step and is
Step3
Step4
-
next
+
next
```
```javascript
@@ -35,11 +35,11 @@ export default {
const active = ref(0)
const next = () => {
- active.value = active.value === 4 ? 0 : active.value + 1
+ active.value = (active.value + 1) % 4
}
return {
- value,
+ active,
next
}
}
@@ -48,98 +48,37 @@ export default {
### Custom Style
-Clicking on `step` will trigger the `click-step` event.
-
```html
-
+
Step1
-
+
Step2
-
+
Step3
-
+
Step4
```
-```javascript
-import { ref } from 'vue'
-
-export default {
- setup() {
- const active = ref(0)
-
- const click = (index) => {
- active.value = index
- }
-
- return {
- value,
- click
- }
- }
-}
-```
-
-### Dynamic steps
-
-Steppers can have their steps dynamically added or removed.
-
-```html
-
-
-
-
- Step{{ i }}
-
-```
-```javascript
-import { ref } from 'vue'
-
-export default {
- setup() {
- const list = ref([2, 3, 4, 5])
- const count = ref(4)
-
- return {
- list,
- count
- }
- }
-}
-```
### Vertical Mode
Change the display direction of the step bar through the `direction` attribute.
```html
-
-
- 2021-02-13
- do something...
-
-
- 2021-02-14
- do something...
-
-
- 2021-02-15
- do something...
-
-
- 2021-02-16
- do something...
-
+
+ Step1
+ Step2
+ Step3
+ Step4
```
diff --git a/packages/varlet-ui/src/steps/docs/zh-CN.md b/packages/varlet-ui/src/steps/docs/zh-CN.md
index f96fd55f9fa..64dd858c8d9 100644
--- a/packages/varlet-ui/src/steps/docs/zh-CN.md
+++ b/packages/varlet-ui/src/steps/docs/zh-CN.md
@@ -24,7 +24,7 @@ createApp().use(Steps).use(Step)
步骤3
步骤4
-
下一步
+
下一步
```
```javascript
@@ -35,11 +35,11 @@ export default {
const active = ref(0)
const next = () => {
- active.value = active.value === 4 ? 0 : active.value + 1
+ active.value = (active.value + 1) % 4
}
return {
- value,
+ active,
next
}
}
@@ -48,98 +48,37 @@ export default {
### 自定义样式
-点击 `step` 会触发`click-step` 事件。
-
```html
-
+
步骤1
-
+
步骤2
-
+
步骤3
-
+
步骤4
```
-```javascript
-import { ref } from 'vue'
-
-export default {
- setup() {
- const active = ref(0)
-
- const click = (index) => {
- active.value = index
- }
-
- return {
- value,
- click
- }
- }
-}
-```
-
-### 动态步骤
-
-步骤条可以动态地添加或移除他们的步骤。
-
-```html
-
-
-
-
- 步骤{{ i }}
-
-```
-```javascript
-import { ref } from 'vue'
-
-export default {
- setup() {
- const list = ref([2, 3, 4, 5])
- const count = ref(4)
-
- return {
- list,
- count
- }
- }
-}
-```
### 垂直模式
通过 `direction` 属性改变步骤条的显示方向。
```html
-
-
- 2021-02-13
- 接下来...
-
-
- 2021-02-14
- 接下来...
-
-
- 2021-02-15
- 接下来...
-
-
- 2021-02-16
- 接下来...
-
+
+ 步骤1
+ 步骤2
+ 步骤3
+ 步骤4
```
diff --git a/packages/varlet-ui/src/steps/example/index.vue b/packages/varlet-ui/src/steps/example/index.vue
index 505c25223eb..57e94d77b16 100644
--- a/packages/varlet-ui/src/steps/example/index.vue
+++ b/packages/varlet-ui/src/steps/example/index.vue
@@ -1,69 +1,37 @@
-
-
{{ pack.basicUsage }}
-
- {{ pack.first }}
- {{ pack.second }}
- {{ pack.third }}
- {{ pack.fourth }}
-
-
- {{ pack.next }}
-
-
-
-
{{ pack.customStyle }}
-
- {{ pack.first }}
- {{ pack.second }}
- {{ pack.third }}
- {{ pack.fourth }}
-
-
-
-
{{ pack.dynamicSteps }}
-
-
-
-
-
-
- {{ pack.step }}{{ i }}
-
-
-
-
{{ pack.vertical }}
-
-
-
- 2021-02-13
- {{ pack.text }}
-
-
- 2021-02-14
- {{ pack.text }}
-
-
- 2021-02-15
- {{ pack.text }}
-
-
- 2021-02-16
- {{ pack.text }}
-
-
-
-
+ {{ pack.basicUsage }}
+
+ {{ pack.first }}
+ {{ pack.second }}
+ {{ pack.third }}
+ {{ pack.fourth }}
+
+ {{ pack.customStyle }}
+
+ {{ pack.first }}
+ {{ pack.second }}
+ {{ pack.third }}
+ {{ pack.fourth }}
+
+ {{ pack.vertical }}
+
+ {{ pack.first }}
+ {{ pack.second }}
+ {{ pack.third }}
+ {{ pack.fourth }}
+
+
+ {{ pack.next }}