@ruixinkeji/prism-ui 1.0.0 → 1.0.2
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/README.md +1 -1
- package/components/PrismAIAssist/PrismAIAssist.vue +98 -98
- package/components/PrismAddressInput/PrismAddressInput.vue +597 -597
- package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -793
- package/components/PrismCityPicker/PrismCityPicker.vue +1008 -1008
- package/components/PrismCitySelect/PrismCitySelect.vue +435 -435
- package/components/PrismCode/PrismCode.vue +749 -749
- package/components/PrismCodeInput/PrismCodeInput.vue +156 -156
- package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -953
- package/components/PrismDropdown/PrismDropdown.vue +77 -77
- package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -352
- package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -253
- package/components/PrismImagePicker/PrismImagePicker.vue +457 -457
- package/components/PrismIndexBar/PrismIndexBar.vue +243 -243
- package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -1100
- package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -530
- package/components/PrismNavBar/PrismNavBar.vue +199 -199
- package/components/PrismSecureInput/PrismSecureInput.vue +360 -360
- package/components/PrismSticky/PrismSticky.vue +173 -173
- package/components/PrismSwiper/PrismSwiper.vue +338 -338
- package/components/PrismSwitch/PrismSwitch.vue +202 -202
- package/components/PrismTabBar/PrismTabBar.vue +147 -147
- package/components/PrismTabs/PrismTabs.vue +49 -49
- package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -529
- package/fonts/fa-brands-400.woff2 +0 -0
- package/fonts/fa-regular-400.woff2 +0 -0
- package/fonts/fa-solid-900.woff2 +0 -0
- package/fonts/fa-v4compatibility.woff2 +0 -0
- package/fonts/font-awesome.css +913 -0
- package/fonts/iconfont.woff2 +0 -0
- package/package.json +7 -1
- package/store/app.d.ts +21 -0
- package/store/app.js +68 -0
- package/styles/base.scss +2 -2
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="prism-dropdown">
|
|
3
|
-
<view class="prism-dropdown__bar">
|
|
4
|
-
<view
|
|
5
|
-
v-for="(item, index) in menuList"
|
|
6
|
-
:key="index"
|
|
7
|
-
class="prism-dropdown__item"
|
|
8
|
-
:class="{ 'prism-dropdown__item--active': activeIndex === index }"
|
|
9
|
-
@click="toggleDropdown(index)"
|
|
10
|
-
>
|
|
11
|
-
<text>{{ item.value }}</text>
|
|
12
|
-
<text class="prism-dropdown__arrow fa fa-chevron-down"></text>
|
|
13
|
-
</view>
|
|
14
|
-
</view>
|
|
15
|
-
|
|
16
|
-
<!-- 下拉面板 -->
|
|
17
|
-
<view
|
|
18
|
-
v-for="(item, index) in menuList"
|
|
19
|
-
:key="'popup-' + index"
|
|
20
|
-
class="prism-dropdown__popup"
|
|
21
|
-
:class="{ 'prism-dropdown__popup--show': activeIndex === index }"
|
|
22
|
-
>
|
|
23
|
-
<view
|
|
24
|
-
v-for="opt in item.options"
|
|
25
|
-
:key="opt"
|
|
26
|
-
class="prism-dropdown__option"
|
|
27
|
-
:class="{ 'prism-dropdown__option--selected': item.value === opt }"
|
|
28
|
-
@click="selectOption(index, opt)"
|
|
29
|
-
>
|
|
30
|
-
<text>{{ opt }}</text>
|
|
31
|
-
<text class="prism-dropdown__check fa fa-check"></text>
|
|
32
|
-
</view>
|
|
33
|
-
</view>
|
|
34
|
-
|
|
35
|
-
<!-- 遮罩层 -->
|
|
36
|
-
<view
|
|
37
|
-
class="prism-dropdown__mask"
|
|
38
|
-
:class="{ 'prism-dropdown__mask--show': activeIndex >= 0 }"
|
|
39
|
-
@click="closeDropdown"
|
|
40
|
-
></view>
|
|
41
|
-
</view>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<script setup>
|
|
45
|
-
import { ref, watch } from 'vue';
|
|
46
|
-
|
|
47
|
-
const props = defineProps({
|
|
48
|
-
menus: {
|
|
49
|
-
type: Array,
|
|
50
|
-
required: true
|
|
51
|
-
// 格式: [{ title: '排序', value: '综合排序', options: ['综合排序', '销量优先'] }]
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const emit = defineEmits(['change']);
|
|
56
|
-
|
|
57
|
-
const activeIndex = ref(-1);
|
|
58
|
-
const menuList = ref([...props.menus]);
|
|
59
|
-
|
|
60
|
-
watch(() => props.menus, (val) => {
|
|
61
|
-
menuList.value = [...val];
|
|
62
|
-
}, { deep: true });
|
|
63
|
-
|
|
64
|
-
function toggleDropdown(index) {
|
|
65
|
-
activeIndex.value = activeIndex.value === index ? -1 : index;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function closeDropdown() {
|
|
69
|
-
activeIndex.value = -1;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function selectOption(index, opt) {
|
|
73
|
-
menuList.value[index].value = opt;
|
|
74
|
-
activeIndex.value = -1;
|
|
75
|
-
emit('change', { index, value: opt, menu: menuList.value[index] });
|
|
76
|
-
}
|
|
77
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="prism-dropdown">
|
|
3
|
+
<view class="prism-dropdown__bar">
|
|
4
|
+
<view
|
|
5
|
+
v-for="(item, index) in menuList"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="prism-dropdown__item"
|
|
8
|
+
:class="{ 'prism-dropdown__item--active': activeIndex === index }"
|
|
9
|
+
@click="toggleDropdown(index)"
|
|
10
|
+
>
|
|
11
|
+
<text>{{ item.value }}</text>
|
|
12
|
+
<text class="prism-dropdown__arrow fa fa-chevron-down"></text>
|
|
13
|
+
</view>
|
|
14
|
+
</view>
|
|
15
|
+
|
|
16
|
+
<!-- 下拉面板 -->
|
|
17
|
+
<view
|
|
18
|
+
v-for="(item, index) in menuList"
|
|
19
|
+
:key="'popup-' + index"
|
|
20
|
+
class="prism-dropdown__popup"
|
|
21
|
+
:class="{ 'prism-dropdown__popup--show': activeIndex === index }"
|
|
22
|
+
>
|
|
23
|
+
<view
|
|
24
|
+
v-for="opt in item.options"
|
|
25
|
+
:key="opt"
|
|
26
|
+
class="prism-dropdown__option"
|
|
27
|
+
:class="{ 'prism-dropdown__option--selected': item.value === opt }"
|
|
28
|
+
@click="selectOption(index, opt)"
|
|
29
|
+
>
|
|
30
|
+
<text>{{ opt }}</text>
|
|
31
|
+
<text class="prism-dropdown__check fa fa-check"></text>
|
|
32
|
+
</view>
|
|
33
|
+
</view>
|
|
34
|
+
|
|
35
|
+
<!-- 遮罩层 -->
|
|
36
|
+
<view
|
|
37
|
+
class="prism-dropdown__mask"
|
|
38
|
+
:class="{ 'prism-dropdown__mask--show': activeIndex >= 0 }"
|
|
39
|
+
@click="closeDropdown"
|
|
40
|
+
></view>
|
|
41
|
+
</view>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup>
|
|
45
|
+
import { ref, watch } from 'vue';
|
|
46
|
+
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
menus: {
|
|
49
|
+
type: Array,
|
|
50
|
+
required: true
|
|
51
|
+
// 格式: [{ title: '排序', value: '综合排序', options: ['综合排序', '销量优先'] }]
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const emit = defineEmits(['change']);
|
|
56
|
+
|
|
57
|
+
const activeIndex = ref(-1);
|
|
58
|
+
const menuList = ref([...props.menus]);
|
|
59
|
+
|
|
60
|
+
watch(() => props.menus, (val) => {
|
|
61
|
+
menuList.value = [...val];
|
|
62
|
+
}, { deep: true });
|
|
63
|
+
|
|
64
|
+
function toggleDropdown(index) {
|
|
65
|
+
activeIndex.value = activeIndex.value === index ? -1 : index;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function closeDropdown() {
|
|
69
|
+
activeIndex.value = -1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function selectOption(index, opt) {
|
|
73
|
+
menuList.value[index].value = opt;
|
|
74
|
+
activeIndex.value = -1;
|
|
75
|
+
emit('change', { index, value: opt, menu: menuList.value[index] });
|
|
76
|
+
}
|
|
77
|
+
</script>
|