@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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/components/PrismAIAssist/PrismAIAssist.vue +98 -98
  3. package/components/PrismAddressInput/PrismAddressInput.vue +597 -597
  4. package/components/PrismCityCascadeSelect/PrismCityCascadeSelect.vue +793 -793
  5. package/components/PrismCityPicker/PrismCityPicker.vue +1008 -1008
  6. package/components/PrismCitySelect/PrismCitySelect.vue +435 -435
  7. package/components/PrismCode/PrismCode.vue +749 -749
  8. package/components/PrismCodeInput/PrismCodeInput.vue +156 -156
  9. package/components/PrismDateTimePicker/PrismDateTimePicker.vue +953 -953
  10. package/components/PrismDropdown/PrismDropdown.vue +77 -77
  11. package/components/PrismGroupSticky/PrismGroupSticky.vue +352 -352
  12. package/components/PrismIdCardInput/PrismIdCardInput.vue +253 -253
  13. package/components/PrismImagePicker/PrismImagePicker.vue +457 -457
  14. package/components/PrismIndexBar/PrismIndexBar.vue +243 -243
  15. package/components/PrismLicensePlateInput/PrismLicensePlateInput.vue +1100 -1100
  16. package/components/PrismMusicPlayer/PrismMusicPlayer.vue +530 -530
  17. package/components/PrismNavBar/PrismNavBar.vue +199 -199
  18. package/components/PrismSecureInput/PrismSecureInput.vue +360 -360
  19. package/components/PrismSticky/PrismSticky.vue +173 -173
  20. package/components/PrismSwiper/PrismSwiper.vue +338 -338
  21. package/components/PrismSwitch/PrismSwitch.vue +202 -202
  22. package/components/PrismTabBar/PrismTabBar.vue +147 -147
  23. package/components/PrismTabs/PrismTabs.vue +49 -49
  24. package/components/PrismVoiceInput/PrismVoiceInput.vue +529 -529
  25. package/fonts/fa-brands-400.woff2 +0 -0
  26. package/fonts/fa-regular-400.woff2 +0 -0
  27. package/fonts/fa-solid-900.woff2 +0 -0
  28. package/fonts/fa-v4compatibility.woff2 +0 -0
  29. package/fonts/font-awesome.css +913 -0
  30. package/fonts/iconfont.woff2 +0 -0
  31. package/package.json +7 -1
  32. package/store/app.d.ts +21 -0
  33. package/store/app.js +68 -0
  34. 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>