tmui-cli 2.0.0 → 2.0.1

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 (134) hide show
  1. package/README.md +56 -8
  2. package/data/components.json +637 -0
  3. package/data/config.json +169 -0
  4. package/data/doc-index.json +61 -0
  5. package/data/docs/alert.md +79 -0
  6. package/data/docs/avatar-group.md +73 -0
  7. package/data/docs/badge.md +62 -0
  8. package/data/docs/between-time.md +76 -0
  9. package/data/docs/button.md +114 -0
  10. package/data/docs/calendar-multiple.md +90 -0
  11. package/data/docs/cell.md +91 -0
  12. package/data/docs/checkbox-group.md +62 -0
  13. package/data/docs/checkbox.md +74 -0
  14. package/data/docs/circle-progress.md +74 -0
  15. package/data/docs/code-input.md +77 -0
  16. package/data/docs/col.md +57 -0
  17. package/data/docs/collapse-item.md +76 -0
  18. package/data/docs/collapse.md +59 -0
  19. package/data/docs/countdown.md +79 -0
  20. package/data/docs/date-view.md +65 -0
  21. package/data/docs/drawer.md +94 -0
  22. package/data/docs/dropdown-item.md +68 -0
  23. package/data/docs/dropdown-menu.md +70 -0
  24. package/data/docs/echart.md +69 -0
  25. package/data/docs/float-drawer.md +79 -0
  26. package/data/docs/form-item.md +67 -0
  27. package/data/docs/form.md +68 -0
  28. package/data/docs/html.md +70 -0
  29. package/data/docs/icon.md +67 -0
  30. package/data/docs/image.md +73 -0
  31. package/data/docs/input.md +126 -0
  32. package/data/docs/modal.md +92 -0
  33. package/data/docs/money.md +70 -0
  34. package/data/docs/more.md +69 -0
  35. package/data/docs/navbar.md +82 -0
  36. package/data/docs/picker-date.md +75 -0
  37. package/data/docs/picker-selected.md +75 -0
  38. package/data/docs/picker-time.md +77 -0
  39. package/data/docs/picker-view.md +70 -0
  40. package/data/docs/picker.md +76 -0
  41. package/data/docs/popover.md +68 -0
  42. package/data/docs/progress.md +72 -0
  43. package/data/docs/pull-refresh.md +73 -0
  44. package/data/docs/radio-group.md +61 -0
  45. package/data/docs/radio.md +74 -0
  46. package/data/docs/rate.md +72 -0
  47. package/data/docs/row.md +61 -0
  48. package/data/docs/sheet.md +72 -0
  49. package/data/docs/sign-board.md +61 -0
  50. package/data/docs/skeleton.md +60 -0
  51. package/data/docs/sku.md +69 -0
  52. package/data/docs/slider-double.md +71 -0
  53. package/data/docs/slider-menu.md +78 -0
  54. package/data/docs/slider.md +71 -0
  55. package/data/docs/stepper.md +76 -0
  56. package/data/docs/steps-item.md +71 -0
  57. package/data/docs/steps.md +73 -0
  58. package/data/docs/sticky-header.md +57 -0
  59. package/data/docs/sticky.md +55 -0
  60. package/data/docs/switch-slider.md +82 -0
  61. package/data/docs/switch.md +68 -0
  62. package/data/docs/tabbar.md +83 -0
  63. package/data/docs/tabs.md +84 -0
  64. package/data/docs/tag.md +78 -0
  65. package/data/docs/text.md +69 -0
  66. package/data/docs/upload-photo.md +86 -0
  67. package/data/docs/upload-video.md +86 -0
  68. package/data/docs//346/250/241/346/235/277.md +47 -0
  69. package/data/examples/alert.vue +39 -0
  70. package/data/examples/avatar-group.vue +97 -0
  71. package/data/examples/badge.vue +87 -0
  72. package/data/examples/between-time.vue +39 -0
  73. package/data/examples/button.vue +70 -0
  74. package/data/examples/calendar-multiple.vue +57 -0
  75. package/data/examples/cell.vue +39 -0
  76. package/data/examples/checkbox.vue +71 -0
  77. package/data/examples/circle-progress.vue +69 -0
  78. package/data/examples/code-input.vue +36 -0
  79. package/data/examples/collapse.vue +76 -0
  80. package/data/examples/countdown.vue +39 -0
  81. package/data/examples/drawer.vue +138 -0
  82. package/data/examples/dropdown-menu.vue +59 -0
  83. package/data/examples/echart.vue +91 -0
  84. package/data/examples/float-drawer.vue +45 -0
  85. package/data/examples/form.vue +147 -0
  86. package/data/examples/html.vue +53 -0
  87. package/data/examples/icon.vue +65 -0
  88. package/data/examples/image.vue +38 -0
  89. package/data/examples/input.vue +66 -0
  90. package/data/examples/modal.vue +122 -0
  91. package/data/examples/money.vue +60 -0
  92. package/data/examples/more.vue +47 -0
  93. package/data/examples/navbar.vue +68 -0
  94. package/data/examples/picker-date.vue +53 -0
  95. package/data/examples/picker-selected.vue +35 -0
  96. package/data/examples/picker-time.vue +46 -0
  97. package/data/examples/picker-view.vue +35 -0
  98. package/data/examples/picker.vue +101 -0
  99. package/data/examples/popover.vue +130 -0
  100. package/data/examples/progress.vue +57 -0
  101. package/data/examples/pull-refresh.vue +41 -0
  102. package/data/examples/radio.vue +61 -0
  103. package/data/examples/rate.vue +35 -0
  104. package/data/examples/row.vue +52 -0
  105. package/data/examples/sheet.vue +36 -0
  106. package/data/examples/sign-board.vue +43 -0
  107. package/data/examples/skeleton.vue +45 -0
  108. package/data/examples/sku.vue +106 -0
  109. package/data/examples/slider-menu.vue +65 -0
  110. package/data/examples/slider.vue +51 -0
  111. package/data/examples/stepper.vue +44 -0
  112. package/data/examples/steps.vue +77 -0
  113. package/data/examples/sticky.vue +46 -0
  114. package/data/examples/switch-slider.vue +113 -0
  115. package/data/examples/switch.vue +62 -0
  116. package/data/examples/tabbar.vue +41 -0
  117. package/data/examples/tabs.vue +46 -0
  118. package/data/examples/tag.vue +69 -0
  119. package/data/examples/text.vue +38 -0
  120. package/data/examples/upload-photo.vue +39 -0
  121. package/data/examples/upload-video.vue +29 -0
  122. package/data/guides/cli.md +110 -0
  123. package/data/guides//344/273/213/347/273/215.md +34 -0
  124. package/data/guides//345/205/274/345/256/271/346/200/247.md +41 -0
  125. package/data/guides//345/215/225/344/275/215/346/240/207/347/255/276/350/257/264/346/230/216.md +22 -0
  126. package/data/guides//345/233/275/351/231/205/345/214/226.md +454 -0
  127. package/data/guides//345/256/211/350/243/205.md +103 -0
  128. package/data/guides//345/260/217/347/250/213/345/272/217/345/210/206/344/272/253.md +34 -0
  129. package/data/guides//345/270/270/350/247/201/351/227/256/351/242/230.md +102 -0
  130. package/data/guides//345/277/253/351/200/237/344/270/212/346/211/213.md +191 -0
  131. package/data/guides//346/233/264/346/226/260/346/227/245/345/277/227.md +155 -0
  132. package/data/guides//350/264/241/347/214/256/350/200/205.md +97 -0
  133. package/dist/main.mjs +78 -66
  134. package/package.json +12 -6
@@ -0,0 +1,122 @@
1
+ <script setup lang="ts">
2
+ import { ref } from "vue";
3
+ const show = ref(false);
4
+ const beforeClose = ():Promise<boolean> => {
5
+ return new Promise((resolve) => {
6
+ setTimeout(() => {
7
+ resolve(true)
8
+ }, 3000)
9
+ })
10
+ }
11
+ </script>
12
+ <template>
13
+ <view>
14
+ <tm-sheet>
15
+ <tm-text font-size="36" class="text-weight-b mb-16 d-block">对话框 tmModal</tm-text>
16
+ <tm-text class="" color="#999999">可全局统一更改风格。</tm-text>
17
+ </tm-sheet>
18
+ <tm-sheet class="flex flex-row flex-row-center-center">
19
+ <tm-modal style="flex: 1; margin-right: 24rpx" height="auto">
20
+ <template v-slot:trigger
21
+ ><tm-button :block="true">自动内容高</tm-button></template
22
+ >
23
+ <tm-input dark-bg-color="" placeholder="请输入密码"></tm-input>
24
+ <tm-input dark-bg-color="" class="my-12" placeholder="请输入密码"></tm-input>
25
+ <view class="flex flex-row flex-row-center-between">
26
+ <tm-text class="text-size-m text-grey">同意协议</tm-text>
27
+ <tm-switch></tm-switch>
28
+ </view>
29
+ </tm-modal>
30
+
31
+ <tm-modal style="flex: 1" position="right" :show-close="true" :show-footer="false">
32
+ <template v-slot:trigger
33
+ ><tm-button :block="true" color="warn">显示关闭</tm-button></template
34
+ >
35
+ <tm-text color="#999999"> 精致美观的对话框,可全局配置风格 </tm-text>
36
+ </tm-modal>
37
+ </tm-sheet>
38
+
39
+ <tm-sheet>
40
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">嵌套</tm-text>
41
+ <tm-modal height="auto">
42
+ <template v-slot:trigger
43
+ ><tm-button color="success" :block="true">打开嵌套</tm-button></template
44
+ >
45
+ <tm-modal height="auto" :beforeClose="beforeClose">
46
+ <template v-slot:trigger
47
+ ><tm-button :block="true">打开嵌套1</tm-button></template
48
+ >
49
+ <tm-text class="text-size-m text-grey line-8">当前弹层内容为自动高度</tm-text>
50
+ <tm-modal height="auto">
51
+ <template v-slot:trigger
52
+ ><tm-button color="success" :block="true">打开嵌套2</tm-button></template
53
+ >
54
+ <tm-text class="text-size-m text-grey line-8">当前弹层内容为自动高度</tm-text>
55
+ </tm-modal>
56
+ </tm-modal>
57
+ </tm-modal>
58
+ </tm-sheet>
59
+
60
+ <tm-sheet>
61
+ <tm-text font-size="36" class="text-weight-b d-block"
62
+ >默认高度,禁用遮罩关闭</tm-text
63
+ >
64
+ <tm-text color="#999999" class="mb-n8 d-block">
65
+ 点击遮罩禁用关闭,同时内容出现弹跳提示
66
+ </tm-text>
67
+
68
+ <tm-modal
69
+ :overlayClick="false"
70
+ :showCancel="false"
71
+ height="550rpx"
72
+ title="请阅读协议"
73
+ confirmText="我已阅读"
74
+ position="right"
75
+ >
76
+ <template #trigger
77
+ ><tm-button :block="true" color="error">禁用遮罩,弹跳提醒</tm-button></template
78
+ >
79
+ <tm-text color="#999999">
80
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
81
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
82
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
83
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
84
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
85
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
86
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
87
+ </tm-text>
88
+ </tm-modal>
89
+ </tm-sheet>
90
+
91
+ <tm-sheet>
92
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block"
93
+ >底部插槽及变量控制显示</tm-text
94
+ >
95
+ <tm-button @click="show = true" :block="true">打开</tm-button>
96
+ <tm-modal
97
+ v-model:show="show"
98
+ title="内容可滚动"
99
+ height="500rpx"
100
+ position="bottom"
101
+ :show-footer="true"
102
+ >
103
+ <tm-text color="#999999">
104
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
105
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
106
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
107
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
108
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
109
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
110
+ 精致美观的对话框,可全局配置风格 精致美观的对话框,可全局配置风格
111
+ </tm-text>
112
+ <template #footer>
113
+ <tm-button @click="show = false" :block="true" color="red" class="flex-1"
114
+ >定义底部插槽</tm-button
115
+ >
116
+ </template>
117
+ </tm-modal>
118
+ </tm-sheet>
119
+
120
+ <view style="height: 50px"></view>
121
+ </view>
122
+ </template>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class="text-weight-b d-block">金额栅格 TmMoney</tm-text>
5
+ <view>
6
+ <tm-text>考虑到这个比较常用,输入金额为数字即可,可以放心的使用保证精度,不采用toFiexd,保证金额精度无舍入</tm-text>
7
+ </view>
8
+ </tm-sheet>
9
+
10
+ <tm-sheet class="flex flex-row flex-row-center-between">
11
+ <tm-text>默认2位小数</tm-text>
12
+ <tm-money :modelValue="1568"></tm-money>
13
+ </tm-sheet>
14
+
15
+ <tm-sheet class="flex flex-row flex-row-center-between">
16
+ <tm-text>开启千分位,小数位为3</tm-text>
17
+ <tm-money :thousand="true" :digit="3" fontSize="30" :modelValue="15568.398"></tm-money>
18
+ </tm-sheet>
19
+ <tm-sheet class="flex flex-row flex-row-center-between">
20
+ <tm-text>千分位为4分割</tm-text>
21
+ <tm-money :thousand="true" :thousandLen="4" :digit="3" :modelValue="15568.398"></tm-money>
22
+ </tm-sheet>
23
+ <tm-sheet class="flex flex-row flex-row-center-between">
24
+ <tm-text>字号控制</tm-text>
25
+ <tm-money :thousand="true" fontSize="48" :digit="3" :modelValue="15568.398"></tm-money>
26
+ </tm-sheet>
27
+ <tm-sheet>
28
+ <tm-text>大写金额(仅到厘,不要超过后4位)</tm-text>
29
+ <view class="flex flex-row flex-row-center-start">
30
+ <tm-money color="warn" darkColor="warn" :showCn="false" fontSize="48" :digit="4"
31
+ :modelValue="money"></tm-money>
32
+ <tm-money class="ml-8" :showCn="true" :digit="4" :modelValue="money"></tm-money>
33
+ </view>
34
+ <tm-button class="mt-n8" :block="true" @click="money = money == 1568.3984 ? 1548.36 : 1568.3984">试试修改金额</tm-button>
35
+ </tm-sheet>
36
+ <tm-sheet>
37
+ <tm-text>去除小数,把小数置0即可,要注意我不会舍入,是直接丢掉小数</tm-text>
38
+ <tm-money :showCn="false" :digit="0" :modelValue="1568.398"></tm-money>
39
+ <tm-text>可以直接写style修改样式</tm-text>
40
+ <tm-money style="font-weight: bold;" :showCn="false" fontSize="48" preFontSize="24"
41
+ :digit="1" :modelValue="1568.398"></tm-money>
42
+ </tm-sheet>
43
+
44
+ <tm-sheet>
45
+ <tm-text>自定义货币符号</tm-text>
46
+ <tm-money symbolText="$" fontSize="40" :modelValue="1568" preFontSize="24"></tm-money>
47
+ <tm-money symbolText=" / 美元" fontSize="40" preFontSize="24" symbolPosition='right'
48
+ :modelValue="1568"></tm-money>
49
+ <tm-money symbolText=" 元/个" fontSize="40" preFontSize="24" symbolPosition='right'
50
+ :modelValue="1568"></tm-money>
51
+ <tm-money symbolText="人民币: " fontSize="40" preFontSize="24" symbolPosition='left'
52
+ :modelValue="1568"></tm-money>
53
+ </tm-sheet>
54
+ </view>
55
+ </template>
56
+ <script setup lang="ts">
57
+ import { ref } from 'vue';
58
+ const money = ref(1568.3984)
59
+ </script>
60
+ <style lang="scss" scoped></style>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">金额栅格 TmMoney</tm-text>
5
+ <view>
6
+ <tm-text>考虑到这个比较常用,输入金额为数字即可,可以放心的使用保证精度,不采用toFiexd,保证金额精度无舍入</tm-text>
7
+ </view>
8
+ </tm-sheet>
9
+
10
+ <tm-sheet class="flex flex-row flex-row-center-between">
11
+ <tm-more>
12
+ 新华社北京12月30日电 国家主席习近平将于31日晚7时通过中央广播电视总台和互联网,发表二〇二六年新年贺词。中央广播电视总台所属中央电视台综合频道、新闻频道、中文国际频道、4K频道,中国国际电视台各外语频道,中央人民广播电台,中国国际广播电台,以及人民网、新华网、央视新闻客户端等中央主要新闻媒体所属网站、新媒体平台将准时播出。
13
+ </tm-more>
14
+ </tm-sheet>
15
+
16
+ <tm-sheet class="flex flex-row flex-row-center-between">
17
+ <tm-more v-model="open" :text="['付费解锁','关闭']" unActiveColor="error" :disabled="true" @click="openClick">
18
+ 新华社北京12月30日电 国家主席习近平将于31日晚7时通过中央广播电视总台和互联网,发表二〇二六年新年贺词。中央广播电视总台所属中央电视台综合频道、新闻频道、中文国际频道、4K频道,中国国际电视台各外语频道,中央人民广播电台,中国国际广播电台,以及人民网、新华网、央视新闻客户端等中央主要新闻媒体所属网站、新媒体平台将准时播出。
19
+ </tm-more>
20
+ </tm-sheet>
21
+
22
+
23
+ </view>
24
+ </template>
25
+ <script setup lang="ts">
26
+ import { ref } from 'vue';
27
+ const open = ref(false)
28
+ const openClick = () => {
29
+ if(open.value){
30
+ open.value = false;
31
+ return
32
+ }
33
+ uni.showModal({
34
+ title: '提示',
35
+ content: '确定要付费打开吗?',
36
+ success: (res) => {
37
+ if (res.confirm) {
38
+ open.value = true
39
+ }
40
+
41
+ }
42
+ })
43
+
44
+
45
+ }
46
+ </script>
47
+ <style lang="scss" scoped></style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <view>
3
+ <tm-navbar :scrollTop="scrollTop" lrWidth='56' :staticTransparent="staticTransparent" :linear-gradient="linear"
4
+ :linearActiveGradient="bgcolor" bg-color="primary" @fiexdChange="navPosChange" title-color="white"
5
+ active-bg-color="#ff5416" title-active-color="yellow" :isPlace="false">
6
+ <template v-slot:title>
7
+ <view class="flex flex-row flex-row-center-start relative flex-1" style="height:100%">
8
+ <tm-input focus-font-color="#ff5416" :focus-highlight="false" placeholder="搜索吧" icon-color="#ff5416"
9
+ round="76" v-if="ratio > 0" left-icon="search-2-line" dark-bg-color="white"
10
+ :style="{ opacity: ratio, width: (ratio * 400) + 'rpx' }" min-height="64">
11
+ <template v-slot:rightIcon>
12
+ <tm-button color="#ff5416" font-size="28" round="76" class="mr-2" height="56"
13
+ width="100">搜索</tm-button>
14
+ </template>
15
+ </tm-input>
16
+ <tm-text v-if="ratio < 1" :style="{ opacity: (1 - ratio), pointerEvents: 'none' }" color='white'
17
+ dark-color="white" class="absolute">NAVBAR 标题栏</tm-text>
18
+ </view>
19
+ </template>
20
+ <template v-slot:right="{ isFiexd }">
21
+ <tm-icon _class="mr-16" name="account-circle-line" size="40"
22
+ :color="(isFiexd as boolean) ? 'yellow' : 'white'"></tm-icon>
23
+ </template>
24
+ </tm-navbar>
25
+ <tm-image src="https://store.tmui.design/api_v2/public/random_picture?random=183"></tm-image>
26
+
27
+ <tm-sheet :margin="['16']">
28
+ <tm-text font-size="36" class=" text-weight-b">标题导航 tmNavbar</tm-text>
29
+ <tm-text class="text-grey line-8 ">可静态悬浮在顶部,也可动态悬浮顶部下拉动态改变背景</tm-text>
30
+ </tm-sheet>
31
+ <tm-sheet height="2000">
32
+ <tm-text font-size="36" class=" text-weight-b ">滚动本页面,查看导航效果</tm-text>
33
+ <tm-text class="text-grey my-20 mb-n8">可静态和悬浮时出现不同的渐变背景</tm-text>
34
+ <tm-button :block="true" @click="setbgcolor">切换渐变导航</tm-button>
35
+ <tm-text class=" text-grey my-20">可静态和悬浮时出现不同的纯色背景</tm-text>
36
+ <tm-button :block="true" @click="clearBgcolor">纯色背景</tm-button>
37
+ <tm-text class=" text-grey my-20">可静态时不透明</tm-text>
38
+ <tm-button :block="true" @click="staticTransparent = !staticTransparent">{{ !staticTransparent ? '静态透明' :
39
+ '静态不透明'
40
+ }}</tm-button>
41
+ </tm-sheet>
42
+ </view>
43
+ </template>
44
+ <script setup lang="ts">
45
+ import { onPageScroll } from '@dcloudio/uni-app';
46
+
47
+ import { ref } from 'vue'
48
+ const ratio = ref(0)
49
+ const bgcolor = ref<string[]>([])
50
+ const linear = ref<string[]>([])
51
+ const staticTransparent = ref(true)
52
+ const scrollTop = ref(0)
53
+ const setbgcolor = () => {
54
+ bgcolor.value = ['to right', '#ff338f', '#6b3eff'];
55
+ linear.value = ['to right', '#02a7ff', '#22e192'];
56
+ }
57
+ const clearBgcolor = () => {
58
+ bgcolor.value = [] as string[]
59
+ linear.value = [] as string[]
60
+ }
61
+ const navPosChange = (posratio: number) => {
62
+ ratio.value = posratio
63
+ }
64
+ onPageScroll((evt: Page.PageScrollOption) => {
65
+ scrollTop.value = evt.scrollTop;
66
+ })
67
+ </script>
68
+ <style scoped></style>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b mb-8 d-block">日期选择器 PickerDate</tm-text>
5
+ <tm-text class="" color="#999999">日期选择,可以控制显示精确到秒。默认的开始时间为当前时间的上一年,结束时间为默认当前时间</tm-text>
6
+ </tm-sheet>
7
+
8
+
9
+ <tm-sheet>
10
+ <tm-picker-date v-model="modelValue" start="2024-1-1" end="2024-9-5" v-model:model-str="nowVal"
11
+ format="YYYY-MM-DD">
12
+ <tm-button :block="true">打开时间</tm-button>
13
+ </tm-picker-date>
14
+
15
+ <tm-sheet :margin="['0', '24', '0', '0']" color="#f5f5f5" dark-color="#333">
16
+ <tm-text color="#999999">选中的值:{{ modelValue }}</tm-text>
17
+ <tm-text color="#999999">经format的值:{{ nowVal }}</tm-text>
18
+ </tm-sheet>
19
+ </tm-sheet>
20
+ <tm-sheet>
21
+ <tm-button skin='thin' :block="true" @click="modelValue = '2024-3-21'">赋值2024-3-21</tm-button>
22
+ </tm-sheet>
23
+
24
+ <tm-sheet>
25
+
26
+ <tm-text font-size="36" class=" text-weight-b mb-n8">内嵌日期选择器 xDateView</tm-text>
27
+ <tm-date-view v-model="nowVal2" start="2022-3-1" end="2024-9-5"></tm-date-view>
28
+ <tm-sheet :margin="['0', '24', '0', '0']" color="#f5f5f5" dark-color="#333">
29
+ <tm-text color="#999999">选中的值:{{ nowVal2 }}</tm-text>
30
+ </tm-sheet>
31
+
32
+ </tm-sheet>
33
+
34
+ <tm-sheet>
35
+ <tm-text font-size="36" class="text-weight-b mb-n8">精确到秒</tm-text>
36
+ </tm-sheet>
37
+ <tm-sheet>
38
+ <tm-picker-date type="second">
39
+ <tm-button :block="true">打开时间</tm-button>
40
+ </tm-picker-date>
41
+ </tm-sheet>
42
+
43
+ </view>
44
+ </template>
45
+
46
+ <script lang="ts" setup>
47
+ import { ref } from 'vue';
48
+ const nowVal = ref("")
49
+ const nowVal2 = ref("")
50
+ const modelValue = ref("")
51
+ </script>
52
+
53
+ <style lang="scss"></style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b mb-8 d-block">搜索选择器 tmPickerSelected</tm-text>
5
+ <tm-text color="#999999" class="text-size-b">
6
+ 可以对提供的列表数据进行搜索,远程加载,单选多选
7
+ </tm-text>
8
+ </tm-sheet>
9
+ <tm-sheet>
10
+
11
+ <tm-picker-selected v-model="codes" v-model:model-str="codes_str" filterKey='name' labelKey="name" idKey="code" :list="city">
12
+ <tm-button :block="true">打开选项</tm-button>
13
+ </tm-picker-selected>
14
+
15
+ <tm-sheet :margin="[0,15,0,0]" color="info">
16
+ {{codes}}
17
+ </tm-sheet>
18
+ <tm-sheet :margin="[0,15,0,0]" color="info">
19
+ {{codes_str}}
20
+ </tm-sheet>
21
+ </tm-sheet>
22
+
23
+ <view style="height: 50px;"></view>
24
+ </view>
25
+ </template>
26
+
27
+ <script lang="ts" setup>
28
+ import { ref } from "vue"
29
+ import city from "@/uni_modules/tm-ui/static/pca-code.json"
30
+ const codes = ref<number[]>([])
31
+ const codes_str = ref<string[]>([])
32
+
33
+ </script>
34
+
35
+ <style lang="scss"></style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b mb-8 d-block">日期选择器 PickerDate</tm-text>
5
+ <tm-text class="" color="#999999">日期选择,可以控制显示精确到秒。默认的开始时间为当前时间的上一年,结束时间为默认当前时间</tm-text>
6
+ </tm-sheet>
7
+
8
+
9
+ <tm-sheet>
10
+ <tm-picker-time v-model="modelValue" v-model:model-str="nowVal"
11
+ format="hh时mm分ss秒">
12
+ <tm-button :block="true">打开时间</tm-button>
13
+ </tm-picker-time>
14
+
15
+ <tm-sheet :margin="['0', '24', '0', '0']" color="#f5f5f5" dark-color="#333">
16
+ <tm-text color="#999999">选中的值:{{ modelValue }}</tm-text>
17
+ <tm-text color="#999999">经format的值:{{ nowVal }}</tm-text>
18
+ </tm-sheet>
19
+ </tm-sheet>
20
+ <tm-sheet>
21
+ <tm-button skin='thin' :block="true" @click="modelValue = '14:30:26'">赋值14:30:26</tm-button>
22
+ </tm-sheet>
23
+
24
+
25
+
26
+ <tm-sheet>
27
+ <tm-text font-size="36" class="text-weight-b ">精确到分{{ modelValue2 }}</tm-text>
28
+ </tm-sheet>
29
+ <tm-sheet>
30
+ <tm-picker-time v-model="modelValue2" v-model:model-str="nowVal2" start="08:30:00" end="22:00:00" type="minute">
31
+ <tm-button :block="true">打开时间</tm-button>
32
+ </tm-picker-time>
33
+ </tm-sheet>
34
+
35
+ </view>
36
+ </template>
37
+
38
+ <script lang="ts" setup>
39
+ import { ref } from 'vue';
40
+ const nowVal = ref("")
41
+ const nowVal2 = ref("")
42
+ const modelValue = ref("")
43
+ const modelValue2 = ref("")
44
+ </script>
45
+
46
+ <style lang="scss"></style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b mb-16 d-block">选择器容器 PickerView</tm-text>
5
+ <tm-text color="#999999" class="text-size-b ">
6
+ 组件采用数组id式选择,非索引。考虑到实际实用中多以id为交互提交数据。因此摒弃了传统的索引选项
7
+ </tm-text>
8
+ </tm-sheet>
9
+
10
+ <tm-sheet>
11
+ <tm-picker-view v-model:model-str="selectedStr" rang-key="code" rang-text="name" @change="change"
12
+ v-model="selecteds"
13
+ :list="city"></tm-picker-view>
14
+ <!-- list -->
15
+ <tm-sheet :margin="['0', '24', '0', '0']" color="#f5f5f5" dark-color="#333">
16
+ <tm-text color="#999999">选中的值:{{ selecteds.join(',') }}</tm-text>
17
+ <tm-text color="#999999">选中项的文本:{{ selectedStr }}</tm-text>
18
+ </tm-sheet>
19
+ </tm-sheet>
20
+ <view style="height:50px"></view>
21
+ </view>
22
+ </template>
23
+ <script lang="ts" setup>
24
+ import { ref } from "vue"
25
+ import city from "@/uni_modules/tm-ui/static/pca-code.json"
26
+
27
+
28
+ const selecteds = ref<string[]>([])
29
+ const selectedStr = ref("")
30
+ const change = (ids: string[]) => {
31
+ console.log(ids)
32
+ }
33
+ </script>
34
+
35
+ <style lang="scss"></style>
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b mb-8 d-block">选择器 tmPicker</tm-text>
5
+ <tm-text color="#999999" class="text-size-b ">
6
+ 这是tmPickerView封装的弹出式,详细可见tmPickerView文档
7
+ </tm-text>
8
+ </tm-sheet>
9
+ <tm-sheet>
10
+
11
+ <tm-picker :list="list">
12
+ <tm-button :block="true">打开选项</tm-button>
13
+ </tm-picker>
14
+
15
+ </tm-sheet>
16
+ <tm-sheet>
17
+ <tm-text font-size="36" class=" text-weight-b mb-n8 d-block">城市选择器</tm-text>
18
+ <tm-picker @change="change" rang-key="code" rang-text="name" v-model="selecteds" v-model:model-str="str"
19
+ :list="city">
20
+ <tm-button :block="true">打开选项</tm-button>
21
+
22
+ </tm-picker>
23
+
24
+ <tm-sheet :margin="['0', '24']" color="#f5f5f5" dark-color="#333">
25
+ <tm-text color="#999999">选中的值:{{ selecteds.join(',') }}</tm-text>
26
+ <tm-text color="#999999">选中的值回显文本:{{ str }}</tm-text>
27
+ </tm-sheet>
28
+ <tm-button skin="thin" :block="true" @click="fuzhi">赋值</tm-button>
29
+ </tm-sheet>
30
+ <view style="height: 50px;"></view>
31
+ </view>
32
+ </template>
33
+
34
+ <script lang="ts" setup>
35
+ import { ref } from "vue"
36
+ import city from "@/uni_modules/tm-ui/static/pca-code.json"
37
+ const list = [
38
+ {
39
+ title: '江西',
40
+ id: "9-1",
41
+ children: [
42
+ {
43
+ title: '南昌',
44
+ id: "132",
45
+ children: [
46
+ { title: '青山湖区', id: "1-2" },
47
+ { title: '高新区', id: "1-3", disabled: true },
48
+ { title: '红谷滩区', id: "1-4" },
49
+ ],
50
+
51
+ },
52
+ {
53
+
54
+ title: '九江', id: "222",
55
+ children: [
56
+ { title: '2青山湖区', id: "1-32" },
57
+ { title: '2高新区', id: "1-33" },
58
+ { title: '3红谷滩区', id: "1-34" },
59
+ ],
60
+ },
61
+ ],
62
+ },
63
+ {
64
+ title: '安徽',
65
+ id: "10-13",
66
+ children: [
67
+ {
68
+ title: '5南昌',
69
+ id: "3",
70
+ children: [
71
+ { title: '5青山湖区', id: "1-52" },
72
+ { title: '5高新区', id: "1-53" },
73
+ { title: '5红谷滩区', id: "1-54" },
74
+ ],
75
+
76
+ },
77
+ {
78
+ title: '5南昌',
79
+ id: "36",
80
+ children: [
81
+ { title: '6青山湖区', id: "61-52" },
82
+ { title: '6高新区', id: "61-53" },
83
+ { title: '6红谷滩区', id: "61-54" },
84
+ ],
85
+
86
+ },
87
+ ],
88
+ },
89
+
90
+ ];
91
+ const selecteds = ref(['15', '1504', '150404'])
92
+ const str = ref("")
93
+ const change = (ids: string[]) => {
94
+ console.log(ids)
95
+ }
96
+ const fuzhi = () => {
97
+ selecteds.value = ['14', '1403', '140311']
98
+ }
99
+ </script>
100
+
101
+ <style lang="scss"></style>