hy-app 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/hy-action-sheet/typing.d.ts +1 -63
- package/components/hy-address-picker/hy-address-picker.vue +7 -6
- package/components/hy-address-picker/typing.d.ts +0 -84
- package/components/hy-avatar/typing.d.ts +0 -66
- package/components/hy-back-top/typing.d.ts +0 -47
- package/components/hy-badge/typing.d.ts +0 -62
- package/components/hy-button/typing.d.ts +28 -162
- package/components/hy-calendar/hy-calendar.vue +2 -2
- package/components/hy-calendar/typing.d.ts +0 -128
- package/components/hy-card/hy-card.vue +12 -12
- package/components/hy-card/index.scss +17 -5
- package/components/hy-card/props.ts +1 -2
- package/components/hy-card/typing.d.ts +1 -114
- package/components/hy-cell/props.ts +1 -1
- package/components/hy-cell/typing.d.ts +0 -55
- package/components/hy-check-button/typing.d.ts +0 -43
- package/components/hy-checkbox/typing.d.ts +1 -73
- package/components/hy-checkbox-group/typing.d.ts +0 -65
- package/components/hy-code-input/typing.d.ts +0 -70
- package/components/hy-count-down/typing.d.ts +1 -20
- package/components/hy-count-to/typing.d.ts +0 -47
- package/components/hy-coupon/typing.d.ts +0 -133
- package/components/hy-datetime-picker/typing.d.ts +0 -119
- package/components/hy-dropdown-item/typing.d.ts +12 -31
- package/components/hy-empty/typing.d.ts +1 -59
- package/components/hy-float-button/typing.d.ts +24 -113
- package/components/hy-form/typing.d.ts +0 -27
- package/components/hy-form-item/hy-form-item.vue +7 -5
- package/components/hy-form-item/typing.d.ts +0 -19
- package/components/hy-grid/typing.d.ts +0 -43
- package/components/hy-icon/typing.d.ts +0 -86
- package/components/hy-image/typing.d.ts +0 -80
- package/components/hy-input/typing.d.ts +0 -149
- package/components/hy-list/typing.d.ts +0 -51
- package/components/hy-menu/typing.d.ts +0 -35
- package/components/hy-modal/typing.d.ts +9 -84
- package/components/hy-navbar/typing.d.ts +0 -81
- package/components/hy-notice-bar/typing.d.ts +0 -65
- package/components/hy-number-step/typing.d.ts +0 -110
- package/components/hy-overlay/typing.d.ts +2 -27
- package/components/hy-pagination/typing.d.ts +6 -49
- package/components/hy-picker/typing.d.ts +27 -124
- package/components/hy-popover/typing.d.ts +25 -66
- package/components/hy-popup/typing.d.ts +8 -77
- package/components/hy-price/typing.d.ts +0 -41
- package/components/hy-qrcode/hy-qrcode.vue +3 -4
- package/components/hy-qrcode/index.scss +3 -3
- package/components/hy-qrcode/qrcode.js +0 -138
- package/components/hy-qrcode/typing.d.ts +0 -66
- package/components/hy-radio/typing.d.ts +1 -86
- package/components/hy-rate/typing.d.ts +0 -62
- package/components/hy-read-more/typing.d.ts +4 -49
- package/components/hy-scroll-list/typing.d.ts +4 -33
- package/components/hy-search/typing.d.ts +19 -120
- package/components/hy-signature/typing.d.ts +0 -101
- package/components/hy-slider/typing.d.ts +8 -77
- package/components/hy-steps/typing.d.ts +16 -60
- package/components/hy-submit-bar/typing.d.ts +0 -72
- package/components/hy-subsection/typing.d.ts +0 -49
- package/components/hy-swipe-action/index.ts +13 -22
- package/components/hy-swipe-action/typing.d.ts +1 -38
- package/components/hy-swiper/typing.d.ts +0 -101
- package/components/hy-switch/typing.d.ts +0 -62
- package/components/hy-tabbar/index.scss +1 -1
- package/components/hy-tabbar/typing.d.ts +0 -40
- package/components/hy-tabbar-item/typing.ts +0 -12
- package/components/hy-tabs/typing.d.ts +25 -92
- package/components/hy-tag/typing.d.ts +9 -78
- package/components/hy-text/typing.d.ts +3 -100
- package/components/hy-textarea/typing.d.ts +0 -27
- package/components/hy-tooltip/props.ts +0 -1
- package/components/hy-tooltip/typing.d.ts +2 -55
- package/components/hy-transition/typing.d.ts +14 -43
- package/components/hy-upload/typing.d.ts +56 -164
- package/components/hy-warn/typing.d.ts +4 -45
- package/package.json +2 -2
- package/web-types.json +1 -1
- package/components/hy-config-provider/typing.d.ts +0 -24
- package/components/hy-divider/typing.d.ts +0 -64
- package/components/hy-dropdown/typing.d.ts +0 -48
- package/components/hy-form-group/typing.d.ts +0 -0
- package/components/hy-line/typing.d.ts +0 -32
- package/components/hy-line-progress/typing.d.ts +0 -32
- package/components/hy-loading/typing.d.ts +0 -52
- package/components/hy-notify/typing.d.ts +0 -48
- package/components/hy-status-bar/typing.d.ts +0 -12
- package/components/hy-tabbar-group/README.md +0 -326
- package/components/hy-waterfall/typing.d.ts +0 -14
- package/components/hy-watermark/typing.d.ts +0 -76
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyConfigProviderProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description dark-暗色、light-亮色
|
|
6
|
-
* */
|
|
7
|
-
theme?: HyApp.DarkModeType
|
|
8
|
-
/**
|
|
9
|
-
* @description 主题色(默认 #3c9cff )
|
|
10
|
-
* */
|
|
11
|
-
themeColor?: string
|
|
12
|
-
/**
|
|
13
|
-
* @description 内边距(默认 10px )
|
|
14
|
-
* */
|
|
15
|
-
padding?: string
|
|
16
|
-
/**
|
|
17
|
-
* @description 定义需要用到的主题类名
|
|
18
|
-
* */
|
|
19
|
-
customClass?: string | string[]
|
|
20
|
-
/**
|
|
21
|
-
* @description 定义需要用到的外部样式
|
|
22
|
-
* */
|
|
23
|
-
customStyle?: CSSProperties | CSSProperties[]
|
|
24
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyDividerProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 是否虚线 (默认 false )
|
|
6
|
-
* */
|
|
7
|
-
dashed?: boolean
|
|
8
|
-
/**
|
|
9
|
-
* @description 是否细线 (默认 true )
|
|
10
|
-
* */
|
|
11
|
-
hairline?: boolean
|
|
12
|
-
/**
|
|
13
|
-
* @description 是否以点替代文字,优先于text字段起作用 (默认 false )
|
|
14
|
-
* */
|
|
15
|
-
dot?: boolean
|
|
16
|
-
/**
|
|
17
|
-
* @description 内容文本的位置,left-左边,center-中间,right-右边 (默认 'center' )
|
|
18
|
-
* */
|
|
19
|
-
textPosition?: HyApp.RowCenterType
|
|
20
|
-
/**
|
|
21
|
-
* @description 文本内容
|
|
22
|
-
* */
|
|
23
|
-
text?: string | 'loadMore' | 'loading' | 'noMore'
|
|
24
|
-
/**
|
|
25
|
-
* @description 文本大小 (默认 14)
|
|
26
|
-
* */
|
|
27
|
-
textSize?: string | number
|
|
28
|
-
/**
|
|
29
|
-
* @description 文本颜色 (默认 '#909399' )
|
|
30
|
-
* */
|
|
31
|
-
textColor?: string
|
|
32
|
-
/**
|
|
33
|
-
* @description 线条颜色 (默认 '#dcdfe6' )
|
|
34
|
-
* */
|
|
35
|
-
lineColor?: string
|
|
36
|
-
/**
|
|
37
|
-
* @description 加载图标(默认 'loading' )
|
|
38
|
-
* */
|
|
39
|
-
loadingIcon?: string
|
|
40
|
-
/**
|
|
41
|
-
* @description 加载前的提示语(默认 '加载更多' )
|
|
42
|
-
* */
|
|
43
|
-
loadMoreText?: string
|
|
44
|
-
/**
|
|
45
|
-
* @description 加载中提示语(默认 '正在加载...' )
|
|
46
|
-
* */
|
|
47
|
-
loadingText?: string
|
|
48
|
-
/**
|
|
49
|
-
* @description 没有更多的提示语(默认 '没有更多了' )
|
|
50
|
-
* */
|
|
51
|
-
noMoreText?: string
|
|
52
|
-
/**
|
|
53
|
-
* @description 上边距 (默认 0 )
|
|
54
|
-
* */
|
|
55
|
-
marginTop?: string | number
|
|
56
|
-
/**
|
|
57
|
-
* @description 下边距 (默认 0 )
|
|
58
|
-
* */
|
|
59
|
-
marginBottom?: string | number
|
|
60
|
-
/**
|
|
61
|
-
* @description 定义需要用到的外部样式
|
|
62
|
-
* */
|
|
63
|
-
customStyle?: CSSProperties
|
|
64
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyDropdownProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 标题和选项卡选中的颜色(默认#2979ff)
|
|
6
|
-
* */
|
|
7
|
-
activeColor?: string
|
|
8
|
-
/**
|
|
9
|
-
* @description 标题和选项卡未选中的颜色(默认#606266)
|
|
10
|
-
* */
|
|
11
|
-
inactiveColor?: string
|
|
12
|
-
/**
|
|
13
|
-
* @description 点击遮罩是否关闭菜单(默认true)
|
|
14
|
-
* */
|
|
15
|
-
closeOnClickMask?: boolean
|
|
16
|
-
/**
|
|
17
|
-
* @description 是否粘性定位(默认true)
|
|
18
|
-
* */
|
|
19
|
-
sticky?: boolean
|
|
20
|
-
/**
|
|
21
|
-
* @description 标题菜单的高度,单位任意(默认80)
|
|
22
|
-
* */
|
|
23
|
-
height?: number | string
|
|
24
|
-
/**
|
|
25
|
-
* @description 标题菜单是否显示下边框(默认false)
|
|
26
|
-
* */
|
|
27
|
-
borderBottom?: boolean
|
|
28
|
-
/**
|
|
29
|
-
* @description 标题的字体大小,单位任意,数值默认为rpx单位(默认28)
|
|
30
|
-
* */
|
|
31
|
-
titleSize?: number
|
|
32
|
-
/**
|
|
33
|
-
* @description 菜单展开内容下方的圆角值,单位任意(默认0)
|
|
34
|
-
* */
|
|
35
|
-
borderRadius?: number
|
|
36
|
-
/**
|
|
37
|
-
* @description 图标名称
|
|
38
|
-
* */
|
|
39
|
-
menuIcon?: string
|
|
40
|
-
/**
|
|
41
|
-
* @description 图标大小
|
|
42
|
-
* */
|
|
43
|
-
menuIconSize?: number
|
|
44
|
-
/**
|
|
45
|
-
* @description 定义需要用到的外部样式
|
|
46
|
-
* */
|
|
47
|
-
customStyle?: CSSProperties
|
|
48
|
-
}
|
|
File without changes
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyLineProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 线条的颜色 ( 默认 '#d6d7d9' )
|
|
6
|
-
* */
|
|
7
|
-
color?: string
|
|
8
|
-
/**
|
|
9
|
-
* @description 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等 ( 默认 '100%' )
|
|
10
|
-
* */
|
|
11
|
-
length?: string | number
|
|
12
|
-
/**
|
|
13
|
-
* @description 线条的方向,row-横向,column-竖向 (默认 'row' )
|
|
14
|
-
* */
|
|
15
|
-
direction?: HyApp.DirectionType
|
|
16
|
-
/**
|
|
17
|
-
* @description 是否显示细线条 (默认 true )
|
|
18
|
-
* */
|
|
19
|
-
hairline?: boolean
|
|
20
|
-
/**
|
|
21
|
-
* @description 线条与上下左右 元素的间距,字符串形式,如"30px" (默认 0 )
|
|
22
|
-
* */
|
|
23
|
-
margin?: string
|
|
24
|
-
/**
|
|
25
|
-
* @description 是否虚线,true-虚线,false-实线 (默认 false )
|
|
26
|
-
* */
|
|
27
|
-
dashed?: boolean
|
|
28
|
-
/**
|
|
29
|
-
* @description 定义需要用到的外部样式
|
|
30
|
-
* */
|
|
31
|
-
customStyle?: CSSProperties
|
|
32
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyLineProgressProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 激活部分的颜色 ( 默认 '#19be6b' )
|
|
6
|
-
* */
|
|
7
|
-
activeColor?: string
|
|
8
|
-
/**
|
|
9
|
-
* @description 背景色 ( 默认 '#ececec' )
|
|
10
|
-
* */
|
|
11
|
-
inactiveColor?: string
|
|
12
|
-
/**
|
|
13
|
-
* @description 进度百分比,数值 ( 默认 0 )
|
|
14
|
-
* */
|
|
15
|
-
percentage: number
|
|
16
|
-
/**
|
|
17
|
-
* @description 是否在进度条内部显示百分比的值 ( 默认 true )
|
|
18
|
-
* */
|
|
19
|
-
showText?: boolean
|
|
20
|
-
/**
|
|
21
|
-
* @description 进度条的高度,单位px ( 默认 12 )
|
|
22
|
-
* */
|
|
23
|
-
height?: string | number
|
|
24
|
-
/**
|
|
25
|
-
* @description 字体大小,单位px ( 默认 10 )
|
|
26
|
-
* */
|
|
27
|
-
fontSize?: string | number
|
|
28
|
-
/**
|
|
29
|
-
* @description 自定义样式
|
|
30
|
-
* */
|
|
31
|
-
customStyle?: CSSProperties
|
|
32
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyLoadingProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 是否显示组件 (默认 true)
|
|
6
|
-
* */
|
|
7
|
-
show?: boolean
|
|
8
|
-
/**
|
|
9
|
-
* @description 动画活动区域的颜色,只对 mode = flower 模式有效
|
|
10
|
-
* */
|
|
11
|
-
color?: string
|
|
12
|
-
/**
|
|
13
|
-
* @description 提示文本的颜色
|
|
14
|
-
* */
|
|
15
|
-
textColor?: string
|
|
16
|
-
/**
|
|
17
|
-
* @description 文字和图标是否垂直排列 (默认 false )
|
|
18
|
-
* */
|
|
19
|
-
vertical?: boolean
|
|
20
|
-
/**
|
|
21
|
-
* @description 模式选择,见官网说明(默认 'circle' )
|
|
22
|
-
* */
|
|
23
|
-
mode?: HyApp.LoadingMode
|
|
24
|
-
/**
|
|
25
|
-
* @description 加载图标的大小,单位px (默认 24 )
|
|
26
|
-
* */
|
|
27
|
-
size?: number | string
|
|
28
|
-
/**
|
|
29
|
-
* @description 文字大小(默认 15 )
|
|
30
|
-
* */
|
|
31
|
-
textSize?: number | string
|
|
32
|
-
/**
|
|
33
|
-
* @description 文字内容
|
|
34
|
-
* */
|
|
35
|
-
text?: string
|
|
36
|
-
/**
|
|
37
|
-
* @description 动画模式 (默认 'ease-in-out' )
|
|
38
|
-
* */
|
|
39
|
-
timingFunction?: 'ease-in-out' | 'linear' | 'ease-in' | 'ease-out' | 'ease'
|
|
40
|
-
/**
|
|
41
|
-
* @description 动画执行周期时间(默认 1200)
|
|
42
|
-
* */
|
|
43
|
-
duration?: number
|
|
44
|
-
/**
|
|
45
|
-
* @description mode=circle时的暗边颜色
|
|
46
|
-
* */
|
|
47
|
-
inactiveColor?: string
|
|
48
|
-
/**
|
|
49
|
-
* @description 定义需要用到的外部样式
|
|
50
|
-
* */
|
|
51
|
-
customStyle?: CSSProperties
|
|
52
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default interface HyNotifyProps {
|
|
4
|
-
/**
|
|
5
|
-
* 到顶部的距离 ( 默认 0 )
|
|
6
|
-
* */
|
|
7
|
-
top?: number
|
|
8
|
-
/**
|
|
9
|
-
* 主题,primary,success,warning,error ( 默认 'primary' )
|
|
10
|
-
* */
|
|
11
|
-
type?: HyApp.ThemeType
|
|
12
|
-
/**
|
|
13
|
-
* 字体颜色 ( 默认 '#ffffff' )
|
|
14
|
-
* */
|
|
15
|
-
color?: string
|
|
16
|
-
/**
|
|
17
|
-
* 背景颜色
|
|
18
|
-
* */
|
|
19
|
-
bgColor?: string
|
|
20
|
-
/**
|
|
21
|
-
* 图标名称
|
|
22
|
-
* */
|
|
23
|
-
icon?: string
|
|
24
|
-
/**
|
|
25
|
-
* 展示的文字内容
|
|
26
|
-
* */
|
|
27
|
-
message?: string
|
|
28
|
-
/**
|
|
29
|
-
* 展示时长,为0时不消失,单位ms ( 默认 3000 )
|
|
30
|
-
* */
|
|
31
|
-
duration?: number
|
|
32
|
-
/**
|
|
33
|
-
* 字体大小 ( 默认 15 )
|
|
34
|
-
* */
|
|
35
|
-
fontSize?: number | string
|
|
36
|
-
/**
|
|
37
|
-
* 回调方法
|
|
38
|
-
* */
|
|
39
|
-
complete?: Function
|
|
40
|
-
/**
|
|
41
|
-
* 是否留出顶部安全距离(状态栏高度) ( 默认 false )
|
|
42
|
-
* */
|
|
43
|
-
safeAreaInsetTop?: boolean
|
|
44
|
-
/**
|
|
45
|
-
* 定义需要用到的外部样式
|
|
46
|
-
* */
|
|
47
|
-
customStyle?: CSSProperties
|
|
48
|
-
}
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
# Hy Tabbar 组件
|
|
2
|
-
|
|
3
|
-
## 介绍
|
|
4
|
-
|
|
5
|
-
Tabbar 是一个底部标签导航组件,用于在应用不同页面之间进行快速切换。支持自定义样式、图标、文字、徽章、激活状态和路由跳转等功能。
|
|
6
|
-
|
|
7
|
-
## 组件关系
|
|
8
|
-
|
|
9
|
-
- `hy-tabbar-group`: 作为容器,管理多个 tabbar-item
|
|
10
|
-
- `hy-tabbar-item`: 作为单个标签项,包含图标、文字和徽章等元素
|
|
11
|
-
|
|
12
|
-
## 引入方式
|
|
13
|
-
|
|
14
|
-
### 全局引入
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
// 在 main.ts 或 index.ts 中引入
|
|
18
|
-
import { createApp } from 'vue'
|
|
19
|
-
import App from './App.vue'
|
|
20
|
-
import HyDesignUni from '@/package'
|
|
21
|
-
|
|
22
|
-
const app = createApp(App)
|
|
23
|
-
app.use(HyDesignUni)
|
|
24
|
-
app.mount('#app')
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 局部引入
|
|
28
|
-
|
|
29
|
-
```vue
|
|
30
|
-
<template>
|
|
31
|
-
<hy-tabbar-group v-model="current">
|
|
32
|
-
<hy-tabbar-item index="0" icon="home" text="首页"></hy-tabbar-item>
|
|
33
|
-
<hy-tabbar-item index="1" icon="discover" text="发现"></hy-tabbar-item>
|
|
34
|
-
</hy-tabbar-group>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script setup lang="ts">
|
|
38
|
-
import { ref } from 'vue'
|
|
39
|
-
import HyTabbarGroup from '@/package/components/hy-tabbar-group/hy-tabbar-group.vue'
|
|
40
|
-
import HyTabbarItem from '@/package/components/hy-tabbar-item/hy-tabbar-item.vue'
|
|
41
|
-
|
|
42
|
-
const current = ref('0')
|
|
43
|
-
</script>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## HyTabbarGroup API
|
|
47
|
-
|
|
48
|
-
### Props
|
|
49
|
-
|
|
50
|
-
| 参数 | 类型 | 默认值 | 必填 | 说明 |
|
|
51
|
-
| --- | --- | --- | --- | --- |
|
|
52
|
-
| v-model | `string \| number` | - | 是 | 当前选中项的索引 |
|
|
53
|
-
| fixed | `boolean` | `false` | 否 | 是否固定在底部 |
|
|
54
|
-
| safe-area-inset-bottom | `boolean` | `false` | 否 | 是否适配底部安全区域 |
|
|
55
|
-
| background | `string` | `#fff` | 否 | 背景色 |
|
|
56
|
-
| height | `string \| number` | `50px` | 否 | 高度 |
|
|
57
|
-
| border-style | `string` | - | 否 | 边框样式,可选值:`solid`、`dashed`、`dotted` |
|
|
58
|
-
| shadow-level | `0 \| 1 \| 2 \| 3` | `0` | 否 | 阴影等级 |
|
|
59
|
-
| active-color | `string` | `#1677ff` | 否 | 激活状态颜色 |
|
|
60
|
-
| inactive-color | `string` | `#606266` | 否 | 非激活状态颜色 |
|
|
61
|
-
| icon-size | `string \| number` | `24` | 否 | 图标大小 |
|
|
62
|
-
| fontSize | `string \| number` | `12` | 否 | 文字大小 |
|
|
63
|
-
| icon-text-space | `string \| number` | `4` | 否 | 图标与文字间距 |
|
|
64
|
-
| indicator-mode | `'none' \| 'bottom' \| 'top' \| 'full'` | `'none'` | 否 | 指示器模式 |
|
|
65
|
-
| indicator-color | `string` | `#1677ff` | 否 | 指示器颜色 |
|
|
66
|
-
| indicator-height | `string \| number` | `3px` | 否 | 指示器高度 |
|
|
67
|
-
| indicator-length | `string \| number` | `20px` | 否 | 指示器长度 |
|
|
68
|
-
| indicator-radius | `string \| number` | `4px` | 否 | 指示器圆角 |
|
|
69
|
-
| transition-duration | `string \| number` | `300` | 否 | 过渡动画时长 |
|
|
70
|
-
| customClass | `string` | - | 否 | 自定义类名 |
|
|
71
|
-
| customStyle | `object` | - | 否 | 自定义样式 |
|
|
72
|
-
| activeClass | `string` | - | 否 | 激活时的自定义类名 |
|
|
73
|
-
|
|
74
|
-
### Events
|
|
75
|
-
|
|
76
|
-
| 事件名 | 说明 | 回调参数 |
|
|
77
|
-
| --- | --- | --- |
|
|
78
|
-
| click | 点击标签项时触发 | `index: string \| number` | 选中项的索引 |
|
|
79
|
-
| change | 选中项改变时触发 | `index: string \| number` | 选中项的索引 |
|
|
80
|
-
| active | 选中项被激活时触发 | `index: string \| number` | 选中项的索引 |
|
|
81
|
-
| update:active | 更新激活状态时触发 | `index: string \| number` | 选中项的索引 |
|
|
82
|
-
|
|
83
|
-
### Slots
|
|
84
|
-
|
|
85
|
-
| 名称 | 说明 | 子标签 |
|
|
86
|
-
| --- | --- | --- |
|
|
87
|
-
| default | 容纳 hy-tabbar-item 子组件 | `<hy-tabbar-item>` |
|
|
88
|
-
|
|
89
|
-
### Expose
|
|
90
|
-
|
|
91
|
-
| 方法名 | 说明 | 参数 |
|
|
92
|
-
| --- | --- | --- |
|
|
93
|
-
| selectItem | 选中指定标签项 | `index: string \| number` | 要选中的索引 |
|
|
94
|
-
| updateRectInfo | 更新位置信息 | - |
|
|
95
|
-
| registerTabItem | 注册标签项 | `item: object` | 标签项信息 |
|
|
96
|
-
| unregisterTabItem | 注销标签项 | `item: object` | 标签项信息 |
|
|
97
|
-
| handleClick | 处理点击事件 | `index: string \| number` | 点击的索引 |
|
|
98
|
-
|
|
99
|
-
## HyTabbarItem API
|
|
100
|
-
|
|
101
|
-
### Props
|
|
102
|
-
|
|
103
|
-
| 参数 | 类型 | 默认值 | 必填 | 说明 |
|
|
104
|
-
| --- | --- | --- | --- | --- |
|
|
105
|
-
| index | `string \| number` | - | 是 | 标签项的索引 |
|
|
106
|
-
| icon | `string` | - | 否 | 图标名称 |
|
|
107
|
-
| text | `string` | - | 否 | 文字内容 |
|
|
108
|
-
| route | `string` | - | 否 | 路由路径 |
|
|
109
|
-
| show-icon | `boolean` | `true` | 否 | 是否显示图标 |
|
|
110
|
-
| hide-text | `boolean` | `false` | 否 | 是否隐藏文字 |
|
|
111
|
-
| disabled | `boolean` | `false` | 否 | 是否禁用 |
|
|
112
|
-
| click-effect | `'none' \| 'feedback' \| 'ripple'` | `'none'` | 否 | 点击效果 |
|
|
113
|
-
| ripple-duration | `string` | `'300ms'` | 否 | 波纹动画时长 |
|
|
114
|
-
| width | `string \| number` | - | 否 | 宽度 |
|
|
115
|
-
| height | `string \| number` | - | 否 | 高度 |
|
|
116
|
-
| show-active-bg | `boolean` | `false` | 否 | 是否显示激活背景 |
|
|
117
|
-
| active-bg-color | `string` | - | 否 | 激活背景颜色 |
|
|
118
|
-
| icon-color | `string` | - | 否 | 图标颜色 |
|
|
119
|
-
| active-icon-color | `string` | - | 否 | 激活时图标颜色 |
|
|
120
|
-
| inactive-icon-color | `string` | - | 否 | 非激活时图标颜色 |
|
|
121
|
-
| text-color | `string` | - | 否 | 文字颜色 |
|
|
122
|
-
| active-text-color | `string` | - | 否 | 激活时文字颜色 |
|
|
123
|
-
| inactive-text-color | `string` | - | 否 | 非激活时文字颜色 |
|
|
124
|
-
| icon-size | `string \| number` | `24` | 否 | 图标大小 |
|
|
125
|
-
| icon-text-space | `string \| number` | `4` | 否 | 图标与文字间距 |
|
|
126
|
-
| badge | `string \| number \| null` | - | 否 | 徽章内容 |
|
|
127
|
-
| badge-offset | `[number, number]` | `[0, 0]` | 否 | 徽章偏移量 |
|
|
128
|
-
| badge-max | `number` | `99` | 否 | 徽章最大值 |
|
|
129
|
-
| badge-is-dot | `boolean` | `false` | 否 | 是否显示为点 |
|
|
130
|
-
| badge-inverted | `boolean` | `false` | 否 | 是否使用浅色背景 |
|
|
131
|
-
| badge-bg-color | `string` | `#ff4d4f` | 否 | 徽章背景色 |
|
|
132
|
-
| badge-text-color | `string` | `#fff` | 否 | 徽章文字颜色 |
|
|
133
|
-
| badge-show-zero | `boolean` | `false` | 否 | 徽章为0时是否显示 |
|
|
134
|
-
| customClass | `string` | - | 否 | 自定义类名 |
|
|
135
|
-
| customStyle | `object` | - | 否 | 自定义样式 |
|
|
136
|
-
| activeClass | `string` | - | 否 | 激活时的自定义类名 |
|
|
137
|
-
|
|
138
|
-
### Events
|
|
139
|
-
|
|
140
|
-
| 事件名 | 说明 | 回调参数 |
|
|
141
|
-
| --- | --- | --- |
|
|
142
|
-
| click | 点击标签项时触发 | `{ index, icon, text }` | 标签项信息 |
|
|
143
|
-
| active | 标签项被激活时触发 | `index: string \| number` | 标签项索引 |
|
|
144
|
-
| change | 标签项状态改变时触发 | `index: string \| number` | 标签项索引 |
|
|
145
|
-
| update:active | 更新激活状态时触发 | `index: string \| number` | 标签项索引 |
|
|
146
|
-
|
|
147
|
-
### Slots
|
|
148
|
-
|
|
149
|
-
| 名称 | 说明 |
|
|
150
|
-
| --- | --- |
|
|
151
|
-
| default | 自定义文字内容 |
|
|
152
|
-
| icon | 自定义图标内容 |
|
|
153
|
-
|
|
154
|
-
## 使用示例
|
|
155
|
-
|
|
156
|
-
### 基础用法
|
|
157
|
-
|
|
158
|
-
```vue
|
|
159
|
-
<hy-tabbar-group v-model="current">
|
|
160
|
-
<hy-tabbar-item index="0" icon="home" text="首页"></hy-tabbar-item>
|
|
161
|
-
<hy-tabbar-item index="1" icon="discover" text="发现"></hy-tabbar-item>
|
|
162
|
-
<hy-tabbar-item index="2" icon="shopping-cart" text="购物车"></hy-tabbar-item>
|
|
163
|
-
<hy-tabbar-item index="3" icon="user" text="我的"></hy-tabbar-item>
|
|
164
|
-
</hy-tabbar-group>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### 固定在底部
|
|
168
|
-
|
|
169
|
-
```vue
|
|
170
|
-
<hy-tabbar-group
|
|
171
|
-
v-model="current"
|
|
172
|
-
fixed
|
|
173
|
-
safe-area-inset-bottom
|
|
174
|
-
background="#fff"
|
|
175
|
-
border-style="solid"
|
|
176
|
-
>
|
|
177
|
-
<hy-tabbar-item index="0" icon="home" text="首页"></hy-tabbar-item>
|
|
178
|
-
<hy-tabbar-item index="1" icon="discover" text="发现"></hy-tabbar-item>
|
|
179
|
-
</hy-tabbar-group>
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### 添加徽章
|
|
183
|
-
|
|
184
|
-
```vue
|
|
185
|
-
<hy-tabbar-group v-model="current">
|
|
186
|
-
<hy-tabbar-item index="0" icon="home" text="首页"></hy-tabbar-item>
|
|
187
|
-
<hy-tabbar-item index="1" icon="message" text="消息" :badge="5"></hy-tabbar-item>
|
|
188
|
-
<hy-tabbar-item index="2" icon="notification" text="通知" badge-is-dot></hy-tabbar-item>
|
|
189
|
-
</hy-tabbar-group>
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### 自定义激活样式
|
|
193
|
-
|
|
194
|
-
```vue
|
|
195
|
-
<hy-tabbar-group
|
|
196
|
-
v-model="current"
|
|
197
|
-
active-color="#ff6b81"
|
|
198
|
-
>
|
|
199
|
-
<hy-tabbar-item
|
|
200
|
-
index="0"
|
|
201
|
-
icon="home"
|
|
202
|
-
text="首页"
|
|
203
|
-
show-active-bg
|
|
204
|
-
active-bg-color="rgba(255, 107, 129, 0.1)"
|
|
205
|
-
></hy-tabbar-item>
|
|
206
|
-
<hy-tabbar-item
|
|
207
|
-
index="1"
|
|
208
|
-
icon="discover"
|
|
209
|
-
text="发现"
|
|
210
|
-
show-active-bg
|
|
211
|
-
active-bg-color="rgba(255, 107, 129, 0.1)"
|
|
212
|
-
></hy-tabbar-item>
|
|
213
|
-
</hy-tabbar-group>
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### 点击效果
|
|
217
|
-
|
|
218
|
-
```vue
|
|
219
|
-
<hy-tabbar-group v-model="current">
|
|
220
|
-
<hy-tabbar-item
|
|
221
|
-
index="0"
|
|
222
|
-
icon="home"
|
|
223
|
-
text="首页"
|
|
224
|
-
click-effect="ripple"
|
|
225
|
-
></hy-tabbar-item>
|
|
226
|
-
<hy-tabbar-item
|
|
227
|
-
index="1"
|
|
228
|
-
icon="discover"
|
|
229
|
-
text="发现"
|
|
230
|
-
click-effect="feedback"
|
|
231
|
-
></hy-tabbar-item>
|
|
232
|
-
</hy-tabbar-group>
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### 路由跳转
|
|
236
|
-
|
|
237
|
-
```vue
|
|
238
|
-
<hy-tabbar-group v-model="current">
|
|
239
|
-
<hy-tabbar-item
|
|
240
|
-
index="0"
|
|
241
|
-
icon="home"
|
|
242
|
-
text="首页"
|
|
243
|
-
route="/pages/index/index"
|
|
244
|
-
></hy-tabbar-item>
|
|
245
|
-
<hy-tabbar-item
|
|
246
|
-
index="1"
|
|
247
|
-
icon="mine"
|
|
248
|
-
text="我的"
|
|
249
|
-
route="/pages/mine/index"
|
|
250
|
-
></hy-tabbar-item>
|
|
251
|
-
</hy-tabbar-group>
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### 指示器模式
|
|
255
|
-
|
|
256
|
-
```vue
|
|
257
|
-
<hy-tabbar-group
|
|
258
|
-
v-model="current"
|
|
259
|
-
indicator-mode="bottom"
|
|
260
|
-
indicator-color="#1677ff"
|
|
261
|
-
indicator-height="3px"
|
|
262
|
-
>
|
|
263
|
-
<hy-tabbar-item index="0" icon="home" text="首页"></hy-tabbar-item>
|
|
264
|
-
<hy-tabbar-item index="1" icon="discover" text="发现"></hy-tabbar-item>
|
|
265
|
-
</hy-tabbar-group>
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
## 多端兼容性说明
|
|
269
|
-
|
|
270
|
-
### H5 端
|
|
271
|
-
- 支持 `vue-router` 路由跳转
|
|
272
|
-
- 支持完整的触摸反馈和波纹效果
|
|
273
|
-
- 支持所有 CSS 动画和过渡效果
|
|
274
|
-
|
|
275
|
-
### 小程序端
|
|
276
|
-
- 使用 `uni.navigateTo` 进行路由跳转
|
|
277
|
-
- 优化了触摸事件处理,确保流畅的交互体验
|
|
278
|
-
- 适配小程序的样式和布局特性
|
|
279
|
-
|
|
280
|
-
### APP 端
|
|
281
|
-
- 支持原生的触摸事件
|
|
282
|
-
- 优化了性能,减少不必要的渲染
|
|
283
|
-
- 适配不同设备的屏幕尺寸和安全区域
|
|
284
|
-
|
|
285
|
-
## 常见问题
|
|
286
|
-
|
|
287
|
-
### 1. 如何实现标签项的动态增减?
|
|
288
|
-
|
|
289
|
-
通过 `v-if` 或 `v-for` 动态渲染 `hy-tabbar-item` 组件,组件会自动注册和注销。
|
|
290
|
-
|
|
291
|
-
### 2. 如何自定义图标?
|
|
292
|
-
|
|
293
|
-
可以使用 `icon` slot 来自定义图标内容,例如:
|
|
294
|
-
|
|
295
|
-
```vue
|
|
296
|
-
<hy-tabbar-item index="0" text="首页">
|
|
297
|
-
<template #icon>
|
|
298
|
-
<image src="/static/custom-icon.png" style="width: 24px; height: 24px;"></image>
|
|
299
|
-
</template>
|
|
300
|
-
</hy-tabbar-item>
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### 3. 如何处理路由跳转?
|
|
304
|
-
|
|
305
|
-
设置 `route` 属性,组件会根据不同端自动选择合适的跳转方式。
|
|
306
|
-
|
|
307
|
-
### 4. 如何适配 iPhone 的底部安全区域?
|
|
308
|
-
|
|
309
|
-
设置 `safe-area-inset-bottom` 属性为 `true`。
|
|
310
|
-
|
|
311
|
-
### 5. 如何自定义徽章样式?
|
|
312
|
-
|
|
313
|
-
使用 `badge-*` 系列属性可以自定义徽章的各种样式,如颜色、大小、位置等。
|
|
314
|
-
|
|
315
|
-
## 组件源码
|
|
316
|
-
|
|
317
|
-
- [hy-tabbar-group](https://github.com/example/hy-design-uni/blob/main/src/package/components/hy-tabbar-group)
|
|
318
|
-
- [hy-tabbar-item](https://github.com/example/hy-design-uni/blob/main/src/package/components/hy-tabbar-item)
|
|
319
|
-
|
|
320
|
-
## 更新日志
|
|
321
|
-
|
|
322
|
-
### v1.0.0
|
|
323
|
-
- 初始版本发布
|
|
324
|
-
- 支持基础的 tabbar 功能
|
|
325
|
-
- 支持自定义样式和交互效果
|
|
326
|
-
- 支持多端适配
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default interface HyWaterfallProps {
|
|
2
|
-
/**
|
|
3
|
-
* @description 数据列表
|
|
4
|
-
* */
|
|
5
|
-
modelValue: Array<any>;
|
|
6
|
-
/**
|
|
7
|
-
* @description 每次向结构插入数据的时间间隔,间隔越长,越能保证两列高度相近,但是对用户体验越不好
|
|
8
|
-
* */
|
|
9
|
-
addTime?: number;
|
|
10
|
-
/**
|
|
11
|
-
* @description id值
|
|
12
|
-
* */
|
|
13
|
-
idKey?: string;
|
|
14
|
-
}
|