hy-app 0.6.4 → 0.6.6
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/attributes.json +1 -1
- package/components/hy-address-picker/hy-address-picker.vue +249 -249
- package/components/hy-address-picker/props.ts +103 -103
- package/components/hy-button/hy-button.vue +320 -289
- package/components/hy-button/props.ts +143 -143
- package/components/hy-button/typing.d.ts +43 -35
- package/components/hy-calendar/header.vue +58 -58
- package/components/hy-calendar/hy-calendar.vue +8 -6
- package/components/hy-calendar/month.vue +402 -402
- package/components/hy-calendar/props.ts +169 -169
- package/components/hy-calendar/typing.d.ts +47 -45
- package/components/hy-cell-item/hy-cell-item.vue +161 -161
- package/components/hy-cell-item/props.ts +59 -59
- package/components/hy-check-button/hy-check-button.vue +135 -135
- package/components/hy-code-input/hy-code-input.vue +231 -231
- package/components/hy-code-input/props.ts +90 -90
- package/components/hy-config-provider/hy-config-provider.vue +53 -53
- package/components/hy-config-provider/props.ts +30 -30
- package/components/hy-coupon/hy-coupon.vue +183 -183
- package/components/hy-coupon/props.ts +108 -108
- package/components/hy-datetime-picker/hy-datetime-picker.vue +41 -55
- package/components/hy-datetime-picker/props.ts +144 -144
- package/components/hy-datetime-picker/typing.d.ts +2 -0
- package/components/hy-divider/props.ts +83 -83
- package/components/hy-empty/icon.ts +72 -72
- package/components/hy-folding-panel/hy-folding-panel-group.vue +162 -162
- package/components/hy-form/hy-form.vue +220 -220
- package/components/hy-icon/hy-icon.vue +112 -112
- package/components/hy-index-bar/hy-index-bar.vue +185 -185
- package/components/hy-index-bar/index.scss +64 -64
- package/components/hy-index-bar/props.ts +94 -94
- package/components/hy-index-bar/typing.d.ts +36 -36
- package/components/hy-input/hy-input.vue +333 -333
- package/components/hy-input/props.ts +186 -186
- package/components/hy-modal/hy-modal.vue +211 -211
- package/components/hy-modal/props.ts +94 -94
- package/components/hy-modal/typing.d.ts +16 -16
- package/components/hy-notice-bar/hy-row-notice.vue +121 -121
- package/components/hy-notify/hy-notify.vue +174 -174
- package/components/hy-number-step/hy-number-step.vue +367 -367
- package/components/hy-overlay/hy-overlay.vue +61 -61
- package/components/hy-overlay/props.ts +38 -38
- package/components/hy-pagination/hy-pagination.vue +136 -136
- package/components/hy-pagination/props.ts +58 -58
- package/components/hy-parse/hy-parse.vue +550 -550
- package/components/hy-parse/node/node.vue +781 -781
- package/components/hy-parse/parser.js +1455 -1455
- package/components/hy-parse/props.ts +19 -19
- package/components/hy-parse/typing.d.ts +68 -68
- package/components/hy-picker/hy-picker.vue +435 -435
- package/components/hy-picker/props.ts +122 -122
- package/components/hy-picker/typing.d.ts +38 -38
- package/components/hy-qrcode/props.ts +72 -72
- package/components/hy-qrcode/qrcode.js.bak +1433 -1433
- package/components/hy-radio/props.ts +97 -97
- package/components/hy-read-more/props.ts +48 -48
- package/components/hy-search/props.ts +133 -133
- package/components/hy-signature/canvasHelper.ts +51 -51
- package/components/hy-signature/props.ts +121 -121
- package/components/hy-skeleton/hy-skeleton.vue +142 -142
- package/components/hy-skeleton/props.ts +46 -46
- package/components/hy-skeleton/typing.d.ts +31 -31
- package/components/hy-steps/hy-steps.vue +275 -275
- package/components/hy-steps/typing.d.ts +25 -25
- package/components/hy-swiper/hy-swiper.vue +3 -3
- package/components/hy-swiper/index.scss +5 -5
- package/components/hy-swiper/props.ts +0 -1
- package/components/hy-table/hy-table.vue +630 -630
- package/components/hy-table/props.ts +62 -62
- package/components/hy-table/typing.d.ts +29 -29
- package/components/hy-tabs/hy-tabs.vue +336 -335
- package/components/hy-tabs/props.ts +84 -77
- package/components/hy-tag/hy-tag.vue +173 -173
- package/components/hy-tag/props.ts +89 -89
- package/components/hy-text/hy-text.vue +237 -237
- package/components/hy-text/props.ts +115 -115
- package/components/hy-textarea/hy-textarea.vue +198 -198
- package/components/hy-toast/hy-toast.vue +200 -200
- package/components/hy-toast/props.ts +3 -3
- package/components/hy-transition/hy-transition.vue +157 -157
- package/components/hy-transition/props.ts +32 -32
- package/components/hy-upload/hy-upload.vue +384 -384
- package/components/hy-watermark/hy-watermark.vue +1058 -1058
- package/components/hy-watermark/props.ts +109 -109
- package/global.d.ts +94 -94
- package/libs/api/http.ts +119 -119
- package/libs/composables/index.ts +8 -8
- package/libs/composables/useMessage.ts +149 -149
- package/libs/composables/useToast.ts +45 -45
- package/libs/composables/useTranslate.ts +10 -10
- package/libs/css/_config.scss +5 -5
- package/libs/index.ts +8 -8
- package/libs/locale/index.ts +32 -32
- package/libs/locale/lang/en-US.ts +84 -84
- package/libs/locale/lang/zh-CN.ts +87 -87
- package/libs/typing/index.ts +2 -2
- package/libs/typing/modules/common.d.ts +139 -139
- package/libs/typing/modules/form.ts +176 -176
- package/libs/typing/modules/http.d.ts +19 -19
- package/libs/typing/modules/index.d.ts +12 -12
- package/libs/utils/inside.ts +340 -340
- package/libs/utils/inspect.ts +140 -140
- package/libs/utils/utils.ts +525 -525
- package/package.json +81 -81
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="hy-index-bar" :class="indexBarClass" :style="indexBarStyle">
|
|
3
|
-
<view class="hy-index-bar__index--list">
|
|
4
|
-
<view
|
|
5
|
-
v-for="(item, index) in indexList"
|
|
6
|
-
:key="index"
|
|
7
|
-
class="hy-index-bar__index--list__item"
|
|
8
|
-
:class="{ 'is-active': modelValue === indexValue(item) }"
|
|
9
|
-
:style="getIndexItemStyle(indexValue(item))"
|
|
10
|
-
@click="handleIndexClick(indexValue(item), $event)"
|
|
11
|
-
@touchstart="handleTouchStart($event)"
|
|
12
|
-
@touchmove="handleTouchMove($event)"
|
|
13
|
-
@touchend="handleTouchEnd"
|
|
14
|
-
>
|
|
15
|
-
{{ indexValue(item) }}
|
|
16
|
-
</view>
|
|
17
|
-
|
|
18
|
-
<!-- 索引字母提示 -->
|
|
19
|
-
<hy-transition :show="showToast && isTouching" :customStyle="toastStyle">
|
|
20
|
-
<view class="hy-index-bar__toast">
|
|
21
|
-
<text class="hy-index-bar__toast--text">{{ modelValue }}</text>
|
|
22
|
-
</view>
|
|
23
|
-
</hy-transition>
|
|
24
|
-
</view>
|
|
25
|
-
</view>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script lang="ts">
|
|
29
|
-
export default {
|
|
30
|
-
name: 'hy-index-bar',
|
|
31
|
-
options: {
|
|
32
|
-
addGlobalClass: true,
|
|
33
|
-
virtualHost: true,
|
|
34
|
-
styleIsolation: 'shared'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<script setup lang="ts">
|
|
40
|
-
import { computed, ref, onMounted, getCurrentInstance, nextTick } from 'vue'
|
|
41
|
-
import type { CSSProperties } from 'vue'
|
|
42
|
-
import type { IIndexBarEmits, IIndexItem } from './typing'
|
|
43
|
-
import { addUnit, getRect, sleep } from '../../libs'
|
|
44
|
-
import indexBarProps from './props'
|
|
45
|
-
// 组件
|
|
46
|
-
import HyTransition from '../hy-transition/hy-transition.vue'
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 索引栏组件,用于快速定位列表内容的索引栏组件,支持点击和滑动两种交互方式
|
|
50
|
-
* @displayName hy-index-bar
|
|
51
|
-
*/
|
|
52
|
-
defineOptions({})
|
|
53
|
-
|
|
54
|
-
const props = defineProps(indexBarProps)
|
|
55
|
-
const emit = defineEmits<IIndexBarEmits>()
|
|
56
|
-
|
|
57
|
-
// 获取当前组件实例
|
|
58
|
-
const instance = getCurrentInstance()
|
|
59
|
-
|
|
60
|
-
// 使用props中的activeIndex,同时保持内部状态用于点击事件
|
|
61
|
-
const isTouching = ref<boolean>(false)
|
|
62
|
-
const lastIndex = ref<string>('')
|
|
63
|
-
const toastStyle = ref<CSSProperties>({
|
|
64
|
-
position: 'absolute',
|
|
65
|
-
left: '-150rpx',
|
|
66
|
-
zIndex: 10
|
|
67
|
-
})
|
|
68
|
-
// 缓存索引栏高度和索引项高度
|
|
69
|
-
const indexBarRect = ref<UniNamespace.NodeInfo>()
|
|
70
|
-
const itemHeight = ref<number>(0)
|
|
71
|
-
|
|
72
|
-
const indexBarClass = computed<string[]>(() => {
|
|
73
|
-
return [`hy-index-bar--${props.position}`]
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const indexBarStyle = computed<CSSProperties>(() => {
|
|
77
|
-
return {
|
|
78
|
-
width: addUnit(props.width),
|
|
79
|
-
height: addUnit(props.height),
|
|
80
|
-
...props.customStyle
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
const indexValue = computed(() => {
|
|
85
|
-
return (item: IIndexItem) => {
|
|
86
|
-
return typeof item === 'object' && item !== null ? item.index : item
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
// 缓存索引项样式,避免重复计算
|
|
91
|
-
const indexItemStyles = computed(() => {
|
|
92
|
-
// 计算通用样式部分
|
|
93
|
-
const commonStyle = {
|
|
94
|
-
width: addUnit(props.width),
|
|
95
|
-
height: addUnit(props.width),
|
|
96
|
-
fontSize: addUnit(props.indexSize)
|
|
97
|
-
} as CSSProperties
|
|
98
|
-
|
|
99
|
-
// 为每个索引项创建样式对象并缓存
|
|
100
|
-
return props.indexList.reduce((styles: Record<string, CSSProperties>, item: IIndexItem) => {
|
|
101
|
-
const isActive = props.modelValue === indexValue.value(item)
|
|
102
|
-
styles[indexValue.value(item)] = {
|
|
103
|
-
...commonStyle,
|
|
104
|
-
color: isActive ? props.activeIndexColor : props.indexColor,
|
|
105
|
-
backgroundColor: isActive ? props.activeIndexBgColor : props.indexBgColor
|
|
106
|
-
}
|
|
107
|
-
return styles
|
|
108
|
-
}, {})
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
// 获取索引项样式的便捷方法
|
|
112
|
-
const getIndexItemStyle = (index: string) => {
|
|
113
|
-
return indexItemStyles.value[index] || {}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const handleIndexClick = (index: string, event: any) => {
|
|
117
|
-
emit('update:modelValue', index)
|
|
118
|
-
emit('click', index, event)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const handleTouchStart = (event: any) => {
|
|
122
|
-
isTouching.value = true
|
|
123
|
-
handleTouchMove(event)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// 触摸移动事件处理
|
|
127
|
-
const handleTouchMove = (event: any) => {
|
|
128
|
-
// 获取触摸点坐标
|
|
129
|
-
const touch = event.touches ? event.touches[0] : event
|
|
130
|
-
const touchY = (touch.clientY || touch.y) - indexBarRect.value?.top!
|
|
131
|
-
|
|
132
|
-
// 计算当前触摸的索引位置
|
|
133
|
-
const index = Math.min(
|
|
134
|
-
Math.max(Math.floor(touchY / itemHeight.value), 0),
|
|
135
|
-
props.indexList.length - 1
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
const clickedIndex = props.indexList[index]?.index || props.indexList[index]
|
|
139
|
-
if (clickedIndex) {
|
|
140
|
-
// 只有当索引发生变化时才更新activeIndex
|
|
141
|
-
if (clickedIndex !== props.modelValue) {
|
|
142
|
-
emit('update:modelValue', clickedIndex)
|
|
143
|
-
emit('scroll', clickedIndex)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// 只有当索引发生变化时才更新toast
|
|
147
|
-
if (clickedIndex !== lastIndex.value) {
|
|
148
|
-
lastIndex.value = clickedIndex
|
|
149
|
-
|
|
150
|
-
// 计算Toast的位置 - 使其与当前索引项对齐
|
|
151
|
-
let toastTop =
|
|
152
|
-
indexBarRect.value?.top! + index * itemHeight.value - 25 + itemHeight.value / 2
|
|
153
|
-
// #ifdef H5
|
|
154
|
-
toastTop = toastTop + 44 // h5需要加上导航栏高度
|
|
155
|
-
// #endif
|
|
156
|
-
toastStyle.value.top = addUnit(toastTop)
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const handleTouchEnd = async () => {
|
|
162
|
-
await sleep(1000)
|
|
163
|
-
isTouching.value = false
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* 获取列表元素属性值
|
|
168
|
-
* */
|
|
169
|
-
const init = () => {
|
|
170
|
-
nextTick(() => {
|
|
171
|
-
getRect('.hy-index-bar__index--list', false, instance).then((rect) => {
|
|
172
|
-
indexBarRect.value = rect
|
|
173
|
-
itemHeight.value = rect.height! / props.indexList.length
|
|
174
|
-
})
|
|
175
|
-
})
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
onMounted(() => {
|
|
179
|
-
init()
|
|
180
|
-
})
|
|
181
|
-
</script>
|
|
182
|
-
|
|
183
|
-
<style lang="scss" scoped>
|
|
184
|
-
@import './index.scss';
|
|
185
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="hy-index-bar" :class="indexBarClass" :style="indexBarStyle">
|
|
3
|
+
<view class="hy-index-bar__index--list">
|
|
4
|
+
<view
|
|
5
|
+
v-for="(item, index) in indexList"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="hy-index-bar__index--list__item"
|
|
8
|
+
:class="{ 'is-active': modelValue === indexValue(item) }"
|
|
9
|
+
:style="getIndexItemStyle(indexValue(item))"
|
|
10
|
+
@click="handleIndexClick(indexValue(item), $event)"
|
|
11
|
+
@touchstart="handleTouchStart($event)"
|
|
12
|
+
@touchmove="handleTouchMove($event)"
|
|
13
|
+
@touchend="handleTouchEnd"
|
|
14
|
+
>
|
|
15
|
+
{{ indexValue(item) }}
|
|
16
|
+
</view>
|
|
17
|
+
|
|
18
|
+
<!-- 索引字母提示 -->
|
|
19
|
+
<hy-transition :show="showToast && isTouching" :customStyle="toastStyle">
|
|
20
|
+
<view class="hy-index-bar__toast">
|
|
21
|
+
<text class="hy-index-bar__toast--text">{{ modelValue }}</text>
|
|
22
|
+
</view>
|
|
23
|
+
</hy-transition>
|
|
24
|
+
</view>
|
|
25
|
+
</view>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
export default {
|
|
30
|
+
name: 'hy-index-bar',
|
|
31
|
+
options: {
|
|
32
|
+
addGlobalClass: true,
|
|
33
|
+
virtualHost: true,
|
|
34
|
+
styleIsolation: 'shared'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import { computed, ref, onMounted, getCurrentInstance, nextTick } from 'vue'
|
|
41
|
+
import type { CSSProperties } from 'vue'
|
|
42
|
+
import type { IIndexBarEmits, IIndexItem } from './typing'
|
|
43
|
+
import { addUnit, getRect, sleep } from '../../libs'
|
|
44
|
+
import indexBarProps from './props'
|
|
45
|
+
// 组件
|
|
46
|
+
import HyTransition from '../hy-transition/hy-transition.vue'
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 索引栏组件,用于快速定位列表内容的索引栏组件,支持点击和滑动两种交互方式
|
|
50
|
+
* @displayName hy-index-bar
|
|
51
|
+
*/
|
|
52
|
+
defineOptions({})
|
|
53
|
+
|
|
54
|
+
const props = defineProps(indexBarProps)
|
|
55
|
+
const emit = defineEmits<IIndexBarEmits>()
|
|
56
|
+
|
|
57
|
+
// 获取当前组件实例
|
|
58
|
+
const instance = getCurrentInstance()
|
|
59
|
+
|
|
60
|
+
// 使用props中的activeIndex,同时保持内部状态用于点击事件
|
|
61
|
+
const isTouching = ref<boolean>(false)
|
|
62
|
+
const lastIndex = ref<string>('')
|
|
63
|
+
const toastStyle = ref<CSSProperties>({
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
left: '-150rpx',
|
|
66
|
+
zIndex: 10
|
|
67
|
+
})
|
|
68
|
+
// 缓存索引栏高度和索引项高度
|
|
69
|
+
const indexBarRect = ref<UniNamespace.NodeInfo>()
|
|
70
|
+
const itemHeight = ref<number>(0)
|
|
71
|
+
|
|
72
|
+
const indexBarClass = computed<string[]>(() => {
|
|
73
|
+
return [`hy-index-bar--${props.position}`]
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const indexBarStyle = computed<CSSProperties>(() => {
|
|
77
|
+
return {
|
|
78
|
+
width: addUnit(props.width),
|
|
79
|
+
height: addUnit(props.height),
|
|
80
|
+
...props.customStyle
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const indexValue = computed(() => {
|
|
85
|
+
return (item: IIndexItem) => {
|
|
86
|
+
return typeof item === 'object' && item !== null ? item.index : item
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
// 缓存索引项样式,避免重复计算
|
|
91
|
+
const indexItemStyles = computed(() => {
|
|
92
|
+
// 计算通用样式部分
|
|
93
|
+
const commonStyle = {
|
|
94
|
+
width: addUnit(props.width),
|
|
95
|
+
height: addUnit(props.width),
|
|
96
|
+
fontSize: addUnit(props.indexSize)
|
|
97
|
+
} as CSSProperties
|
|
98
|
+
|
|
99
|
+
// 为每个索引项创建样式对象并缓存
|
|
100
|
+
return props.indexList.reduce((styles: Record<string, CSSProperties>, item: IIndexItem) => {
|
|
101
|
+
const isActive = props.modelValue === indexValue.value(item)
|
|
102
|
+
styles[indexValue.value(item)] = {
|
|
103
|
+
...commonStyle,
|
|
104
|
+
color: isActive ? props.activeIndexColor : props.indexColor,
|
|
105
|
+
backgroundColor: isActive ? props.activeIndexBgColor : props.indexBgColor
|
|
106
|
+
}
|
|
107
|
+
return styles
|
|
108
|
+
}, {})
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// 获取索引项样式的便捷方法
|
|
112
|
+
const getIndexItemStyle = (index: string) => {
|
|
113
|
+
return indexItemStyles.value[index] || {}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const handleIndexClick = (index: string, event: any) => {
|
|
117
|
+
emit('update:modelValue', index)
|
|
118
|
+
emit('click', index, event)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const handleTouchStart = (event: any) => {
|
|
122
|
+
isTouching.value = true
|
|
123
|
+
handleTouchMove(event)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// 触摸移动事件处理
|
|
127
|
+
const handleTouchMove = (event: any) => {
|
|
128
|
+
// 获取触摸点坐标
|
|
129
|
+
const touch = event.touches ? event.touches[0] : event
|
|
130
|
+
const touchY = (touch.clientY || touch.y) - indexBarRect.value?.top!
|
|
131
|
+
|
|
132
|
+
// 计算当前触摸的索引位置
|
|
133
|
+
const index = Math.min(
|
|
134
|
+
Math.max(Math.floor(touchY / itemHeight.value), 0),
|
|
135
|
+
props.indexList.length - 1
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
const clickedIndex = props.indexList[index]?.index || props.indexList[index]
|
|
139
|
+
if (clickedIndex) {
|
|
140
|
+
// 只有当索引发生变化时才更新activeIndex
|
|
141
|
+
if (clickedIndex !== props.modelValue) {
|
|
142
|
+
emit('update:modelValue', clickedIndex)
|
|
143
|
+
emit('scroll', clickedIndex)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 只有当索引发生变化时才更新toast
|
|
147
|
+
if (clickedIndex !== lastIndex.value) {
|
|
148
|
+
lastIndex.value = clickedIndex
|
|
149
|
+
|
|
150
|
+
// 计算Toast的位置 - 使其与当前索引项对齐
|
|
151
|
+
let toastTop =
|
|
152
|
+
indexBarRect.value?.top! + index * itemHeight.value - 25 + itemHeight.value / 2
|
|
153
|
+
// #ifdef H5
|
|
154
|
+
toastTop = toastTop + 44 // h5需要加上导航栏高度
|
|
155
|
+
// #endif
|
|
156
|
+
toastStyle.value.top = addUnit(toastTop)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const handleTouchEnd = async () => {
|
|
162
|
+
await sleep(1000)
|
|
163
|
+
isTouching.value = false
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* 获取列表元素属性值
|
|
168
|
+
* */
|
|
169
|
+
const init = () => {
|
|
170
|
+
nextTick(() => {
|
|
171
|
+
getRect('.hy-index-bar__index--list', false, instance).then((rect) => {
|
|
172
|
+
indexBarRect.value = rect
|
|
173
|
+
itemHeight.value = rect.height! / props.indexList.length
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
onMounted(() => {
|
|
179
|
+
init()
|
|
180
|
+
})
|
|
181
|
+
</script>
|
|
182
|
+
|
|
183
|
+
<style lang="scss" scoped>
|
|
184
|
+
@import './index.scss';
|
|
185
|
+
</style>
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
@use "../../libs/css/mixin" as *;
|
|
2
|
-
@use "../../libs/css/theme" as *;
|
|
3
|
-
|
|
4
|
-
@include b(index-bar) {
|
|
5
|
-
position: fixed;
|
|
6
|
-
top: 0;
|
|
7
|
-
bottom: 0;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
z-index: 999;
|
|
13
|
-
transform: translateZ(0);
|
|
14
|
-
-webkit-transform: translateZ(0);
|
|
15
|
-
|
|
16
|
-
@include m(left) {
|
|
17
|
-
left: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@include m(right) {
|
|
21
|
-
right: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@include e(index) {
|
|
25
|
-
@include m(list) {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
align-items: center;
|
|
29
|
-
margin-right: $hy-border-margin-padding-base;
|
|
30
|
-
|
|
31
|
-
@include e(item) {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
color: $hy-text-color--3;
|
|
36
|
-
margin: 2rpx 0;
|
|
37
|
-
border-radius: $hy-border-radius-sm;
|
|
38
|
-
|
|
39
|
-
@include is(active) {
|
|
40
|
-
position: relative;
|
|
41
|
-
color: $hy-primary;
|
|
42
|
-
background: $hy-background--hover;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@include e(toast) {
|
|
49
|
-
width: 50px;
|
|
50
|
-
height: 50px;
|
|
51
|
-
border-radius: 100px 100px 0 100px;
|
|
52
|
-
text-align: center;
|
|
53
|
-
color: #ffffff;
|
|
54
|
-
background-color: $hy-background--empty;
|
|
55
|
-
transform: rotate(-45deg);
|
|
56
|
-
display: flex;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
align-items: center;
|
|
59
|
-
|
|
60
|
-
@include m(text) {
|
|
61
|
-
transform: rotate(45deg);
|
|
62
|
-
font-size: $hy-font-size-lg;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
@use "../../libs/css/mixin" as *;
|
|
2
|
+
@use "../../libs/css/theme" as *;
|
|
3
|
+
|
|
4
|
+
@include b(index-bar) {
|
|
5
|
+
position: fixed;
|
|
6
|
+
top: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
z-index: 999;
|
|
13
|
+
transform: translateZ(0);
|
|
14
|
+
-webkit-transform: translateZ(0);
|
|
15
|
+
|
|
16
|
+
@include m(left) {
|
|
17
|
+
left: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include m(right) {
|
|
21
|
+
right: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@include e(index) {
|
|
25
|
+
@include m(list) {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: center;
|
|
29
|
+
margin-right: $hy-border-margin-padding-base;
|
|
30
|
+
|
|
31
|
+
@include e(item) {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
color: $hy-text-color--3;
|
|
36
|
+
margin: 2rpx 0;
|
|
37
|
+
border-radius: $hy-border-radius-sm;
|
|
38
|
+
|
|
39
|
+
@include is(active) {
|
|
40
|
+
position: relative;
|
|
41
|
+
color: $hy-primary;
|
|
42
|
+
background: $hy-background--hover;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include e(toast) {
|
|
49
|
+
width: 50px;
|
|
50
|
+
height: 50px;
|
|
51
|
+
border-radius: 100px 100px 0 100px;
|
|
52
|
+
text-align: center;
|
|
53
|
+
color: #ffffff;
|
|
54
|
+
background-color: $hy-background--empty;
|
|
55
|
+
transform: rotate(-45deg);
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
align-items: center;
|
|
59
|
+
|
|
60
|
+
@include m(text) {
|
|
61
|
+
transform: rotate(45deg);
|
|
62
|
+
font-size: $hy-font-size-lg;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
65
|
}
|