mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types(Steps): export StepsDirection type (#9664)
* types(Steps): export StepsDirection type * fix: evnt * chore: upd * Revert "chore: upd" This reverts commit df01337207ced0ad54e6e4a6172dac255bd292ac.
This commit is contained in:
parent
32e9f7fdbb
commit
4bc2557c5a
@ -44,16 +44,13 @@ export default defineComponent({
|
|||||||
index: number,
|
index: number,
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
) => {
|
) => {
|
||||||
const onEdit = () => {
|
const onEdit = () =>
|
||||||
const name = disabled ? 'edit-disabled' : 'edit';
|
emit(disabled ? 'edit-disabled' : 'edit', item, index);
|
||||||
emit(name, item, index);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onClick = () => emit('click-item', item, index);
|
const onClick = () => emit('click-item', item, index);
|
||||||
|
|
||||||
const onSelect = () => {
|
const onSelect = () => {
|
||||||
const name = disabled ? 'select-disabled' : 'select';
|
emit(disabled ? 'select-disabled' : 'select', item, index);
|
||||||
emit(name, item, index);
|
|
||||||
|
|
||||||
if (!disabled) {
|
if (!disabled) {
|
||||||
emit('update:modelValue', item.id);
|
emit('update:modelValue', item.id);
|
||||||
|
@ -89,10 +89,11 @@ export default {
|
|||||||
### Step Slots
|
### Step Slots
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| -------------------- | -------------------- | -------- | --- |
|
| -------------------- | -------------------- |
|
||||||
|
| default | Step content |
|
||||||
| active-icon | Custom active icon |
|
| active-icon | Custom active icon |
|
||||||
| inactive-icon | Custom inactive icon |
|
| inactive-icon | Custom inactive icon |
|
||||||
| finish-icon `v3.0.7` | Custom finish icon | _string_ | - |
|
| finish-icon `v3.0.7` | Custom finish icon |
|
||||||
|
|
||||||
### Steps Events
|
### Steps Events
|
||||||
|
|
||||||
@ -100,6 +101,14 @@ export default {
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| click-step | Emitted when a step's title or icon is clicked | _index: number_ |
|
| click-step | Emitted when a step's title or icon is clicked | _index: number_ |
|
||||||
|
|
||||||
|
### Types
|
||||||
|
|
||||||
|
The component exports the following type definitions:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { StepsDirection } from 'vant';
|
||||||
|
```
|
||||||
|
|
||||||
## Theming
|
## Theming
|
||||||
|
|
||||||
### CSS Variables
|
### CSS Variables
|
||||||
|
@ -95,10 +95,11 @@ export default {
|
|||||||
### Step Slots
|
### Step Slots
|
||||||
|
|
||||||
| 名称 | 说明 |
|
| 名称 | 说明 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- |
|
||||||
|
| default | 步骤内容 |
|
||||||
| active-icon | 自定义激活状态图标 |
|
| active-icon | 自定义激活状态图标 |
|
||||||
| inactive-icon | 自定义未激活状态图标 |
|
| inactive-icon | 自定义未激活状态图标 |
|
||||||
| finish-icon `v3.0.7` | 自定义已完成步骤对应的底部图标,优先级高于 `inactive-icon` | _string_ | - |
|
| finish-icon `v3.0.7` | 自定义已完成步骤对应的底部图标,优先级高于 `inactive-icon` |
|
||||||
|
|
||||||
### Steps Events
|
### Steps Events
|
||||||
|
|
||||||
@ -106,6 +107,14 @@ export default {
|
|||||||
| ---------- | -------------------------- | --------------- |
|
| ---------- | -------------------------- | --------------- |
|
||||||
| click-step | 点击步骤的标题或图标时触发 | _index: number_ |
|
| click-step | 点击步骤的标题或图标时触发 | _index: number_ |
|
||||||
|
|
||||||
|
### 类型定义
|
||||||
|
|
||||||
|
组件导出以下类型定义:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import type { StepsDirection } from 'vant';
|
||||||
|
```
|
||||||
|
|
||||||
## 主题定制
|
## 主题定制
|
||||||
|
|
||||||
### 样式变量
|
### 样式变量
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { withInstall } from '../utils';
|
import { withInstall } from '../utils';
|
||||||
import _Steps from './Steps';
|
import _Steps, { StepsDirection } from './Steps';
|
||||||
|
|
||||||
export const Steps = withInstall(_Steps);
|
export const Steps = withInstall(_Steps);
|
||||||
export default Steps;
|
export default Steps;
|
||||||
|
export type { StepsDirection };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user