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,65 @@
1
+ <template>
2
+ <view class="flex-1 flex flex-col" style="height: 100%;">
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class="text-weight-b d-block">侧边菜单 TmSliderMenu</tm-text>
5
+ <view>
6
+ <tm-text>方便侧边菜单右边内容管理,示例写了个双向定位展示的样板,方便大家复制直接使用。样式非常灵活,可以任意定制你想要的格式,也兼容PC端</tm-text>
7
+ </view>
8
+ </tm-sheet>
9
+ <view class="flex-1 mx-n6 round-4 overflow">
10
+ <tm-slider-menu
11
+ v-model="defaultSelected"
12
+ height="100%"
13
+ :list='list'
14
+ slider-bg-color="#efefef"
15
+ >
16
+ <template v-slot:default="{item}">
17
+ <view class="sticky t-0 l-0 fulled px-20 white flex flex-row flex-row-center-start text-weight-b"
18
+ style="height: 88rpx;background-color: white;">
19
+ <tm-text font-size="32">#{{item.id}}{{item.title}}</tm-text>
20
+ </view>
21
+ <view class="px-20 white flex flex-wrap flex-row gap-10">
22
+ <view class="flex-shrink flex flex-center"
23
+ style="height:120px;width:calc(33% - 20rpx);background-color: #f5f5f5;"
24
+ v-for="(item2,index2) in 8" :key="index2">
25
+ {{item2}}
26
+ </view>
27
+ </view>
28
+ </template>
29
+
30
+ </tm-slider-menu>
31
+ </view>
32
+ </view>
33
+
34
+ </template>
35
+ <script setup lang="ts">
36
+ import { ref } from "vue"
37
+ const defaultSelected = ref(2)
38
+ const list = ref([
39
+ { id: 1, title: "水果" },
40
+ { id: 2, title: "蔬菜" },
41
+ { id: 3, title: "肉类" },
42
+ { id: 4, title: "海鲜" },
43
+ { id: 5, title: "酒水" },
44
+ { id: 6, title: "饮料" },
45
+ { id: 7, title: "零食" },
46
+ { id: 8, title: "水果" },
47
+ { id: 9, title: "蔬菜" },
48
+ { id: 10, title: "肉类" },
49
+ { id: 11, title: "海鲜" },
50
+ { id: 12, title: "酒水" },
51
+ { id: 13, title: "饮料" },
52
+ { id: 14, title: "零食" },
53
+ { id: 15, title: "水果" },
54
+ ])
55
+ </script>
56
+
57
+ <style lang="scss">
58
+ page,
59
+ body,
60
+ html {
61
+ height: 100%;
62
+ display: flex;
63
+ flex-direction: column;
64
+ }
65
+ </style>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <tm-sheet>
3
+ <tm-text font-size="36" class="text-weight-b d-block">单向滑块 TmSlider</tm-text>
4
+ <view>
5
+ <tm-text>分单向和双向滑动条</tm-text>
6
+ </view>
7
+ </tm-sheet>
8
+
9
+ <tm-sheet>
10
+ <view class="mt-n8">
11
+ <tm-slider v-model="val" ></tm-slider>
12
+ </view>
13
+ <view class="mt-n16">
14
+ <tm-slider v-model="val" color="success" ></tm-slider>
15
+ </view>
16
+ <view class="mt-n16">
17
+ <tm-slider v-model="val" size="36" color="error" btn-size="36" round="36"></tm-slider>
18
+ </view>
19
+ <view class="mt-n16">
20
+ <tm-button @click="val=80" block>手动赋值</tm-button>
21
+ </view>
22
+ </tm-sheet>
23
+ <tm-sheet>
24
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">显示标签及渐变背景</tm-text>
25
+ <view class="mt-n16">
26
+ <tm-slider showLabel color="#4DEF8E" btn-size="50" linear-color="linear-gradient(to right, #FFEB3A 0%, #4DEF8E 100%)"></tm-slider>
27
+ </view>
28
+ </tm-sheet>
29
+ <tm-sheet>
30
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">步进值20</tm-text>
31
+ <view class="mt-n16">
32
+ <tm-slider showLabel color="error" :step="20" ></tm-slider>
33
+ </view>
34
+ </tm-sheet>
35
+ <tm-sheet>
36
+ <tm-text font-size="36" class="text-weight-b d-block ">双向向滑块 TmSlider</tm-text>
37
+ </tm-sheet>
38
+
39
+ <tm-sheet>
40
+ <view class="mt-n16">
41
+ <tm-slider-double showLabel color="#4DEF8E" btn-size="50" linear-color="linear-gradient(to right, #FFEB3A 0%, #4DEF8E 100%)"></tm-slider-double>
42
+ </view>
43
+ </tm-sheet>
44
+ <view style="height: 80px;"></view>
45
+ </template>
46
+ <script setup lang="ts">
47
+ import { ref } from 'vue';
48
+
49
+ const val = ref(50)
50
+ </script>
51
+ <style lang="scss"></style>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b mb-8 d-block">步进器 Stepper</tm-text>
5
+ <tm-text class="" color="#999999">可整数,小数步进</tm-text>
6
+ </tm-sheet>
7
+
8
+ <tm-sheet class="flex fletm-row">
9
+ <tm-stepper width="220"></tm-stepper>
10
+ </tm-sheet>
11
+ <tm-sheet>
12
+ <tm-text font-size="36" class="text-weight-b d-block ">小数点</tm-text>
13
+ </tm-sheet>
14
+ <tm-sheet class="flex fletm-row">
15
+ <tm-stepper :decimal-len="1" :step="0.1" width="220"></tm-stepper>
16
+ </tm-sheet>
17
+ <tm-sheet>
18
+ <tm-text font-size="36" class="text-weight-b d-block ">圆角类型</tm-text>
19
+ </tm-sheet>
20
+ <tm-sheet class="flex fletm-row">
21
+ <tm-stepper :splitBtn="true" :model-value="50" width="220"></tm-stepper>
22
+ </tm-sheet>
23
+ <tm-sheet>
24
+ <tm-text font-size="36" class="text-weight-b d-block ">自动隐藏减号</tm-text>
25
+ </tm-sheet>
26
+ <tm-sheet class="flex fletm-row">
27
+ <tm-stepper :autoHideBtn="true" :splitBtn="true" width="220"></tm-stepper>
28
+ </tm-sheet>
29
+ <tm-sheet>
30
+ <tm-text font-size="36" class="text-weight-b d-block ">更换颜色</tm-text>
31
+ </tm-sheet>
32
+ <tm-sheet class="flex fletm-row">
33
+ <tm-stepper darkBtnColor="primary" btn-color="primary" btn-font-color="white" font-color="primary"
34
+ :splitBtn="true" :model-value="10" width="220"></tm-stepper>
35
+ </tm-sheet>
36
+
37
+
38
+
39
+ </view>
40
+ </template>
41
+
42
+ <script setup lang="ts">
43
+ import { ref } from 'vue'
44
+ </script>
@@ -0,0 +1,77 @@
1
+ <!--
2
+ - Copyright (c) 2025. tmzdy by @https://tmui.design
3
+ -->
4
+
5
+ <script setup lang="ts">
6
+ import { ref } from 'vue'
7
+
8
+ const current = ref(3)
9
+ const onChange = (index:number)=>{
10
+ console.log(index)
11
+ }
12
+ </script>
13
+
14
+ <template>
15
+ <tm-sheet>
16
+ <tm-text class=" text-weight-b d-block" font-size="32">步骤条 tmSteps</tm-text>
17
+ <tm-text class="" color="#999999">
18
+ 子组件独立,方便灵活自定义。
19
+ </tm-text>
20
+ </tm-sheet>
21
+
22
+ <tm-sheet>
23
+ <tm-text class=" text-weight-b mb-n8 d-block" font-size="32">隐藏标签</tm-text>
24
+ <tm-steps :model-value="2" :show-footer="false">
25
+ <tm-steps-item v-for="item in 5" :key="item"></tm-steps-item>
26
+ </tm-steps>
27
+ </tm-sheet>
28
+ <tm-sheet>
29
+ <tm-text class=" text-weight-b mb-n8 d-block" font-size="32">完全自定义状态</tm-text>
30
+ <tm-steps :model-value="1" :show-footer="false" icon-size="36">
31
+ <tm-steps-item v-for="item in 5" :key="item">
32
+ <template v-slot:icon="{active}" >
33
+ <tm-sheet
34
+ :color="active?'primary':'#f5f5f5'"
35
+ class="flex flex-center" height="100%" margin="0" padding="0" round="50%" width="100%">
36
+ <tm-text :color="active?'#fff':'#888'" fontSize="22" >{{item}}</tm-text>
37
+ </tm-sheet>
38
+ </template>
39
+ </tm-steps-item>
40
+ </tm-steps>
41
+ </tm-sheet>
42
+ <tm-sheet>
43
+ <tm-text class=" text-weight-b d-block" font-size="32">显示标签</tm-text>
44
+ <tm-text class="mb-n8" color="#999999">
45
+ 自定状态及进度。并允许点击交互改变进度。
46
+ </tm-text>
47
+ <tm-steps v-model="current" :disabled="false">
48
+ <tm-steps-item>注册帐号</tm-steps-item>
49
+ <tm-steps-item >审核</tm-steps-item>
50
+ <tm-steps-item active-color="error" active-icon="user-unfollow-line">发放牌证</tm-steps-item>
51
+ <tm-steps-item active-color="error" active-icon="close-circle-line">结算</tm-steps-item>
52
+ </tm-steps>
53
+ </tm-sheet>
54
+
55
+ <tm-sheet>
56
+ <tm-text class=" text-weight-b d-block" font-size="32">显示标签</tm-text>
57
+ <tm-text class="mb-n8" color="#999999">
58
+ 自定状态及进度。并允许点击交互改变进度。
59
+ </tm-text>
60
+ <tm-steps v-model="current" :disabled="false" :reverse="true" :vertical="true" @change="onChange">
61
+ <tm-steps-item>注册帐号</tm-steps-item>
62
+ <tm-steps-item >
63
+ <template v-slot:default="{active}">
64
+ <tm-sheet :color="active?'primary':'#fff'" :margin="[0,0,0,16]" shadow="20">
65
+ <tm-text :color="active?'#fff':''">自定义布局外观</tm-text>
66
+ </tm-sheet>
67
+ </template>
68
+ </tm-steps-item>
69
+ <tm-steps-item active-color="error" active-icon="user-unfollow-line" desc="发放失败,资料不齐全,请重新提交资料">发放牌证</tm-steps-item>
70
+ <tm-steps-item active-color="error" active-icon="close-circle-line" desc="无法结算">结算</tm-steps-item>
71
+ </tm-steps>
72
+ </tm-sheet>
73
+ </template>
74
+
75
+ <style scoped>
76
+
77
+ </style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <view >
3
+ <tm-sticky>
4
+ <tm-sheet>
5
+ <tm-text font-size="36" class="text-weight-b d-block">粘性布局 TmStikcy</tm-text>
6
+ <view>
7
+ <tm-text>可以当作页面根节点悬浮,也可以当作局部悬浮总之方便.如果当页面根节点也不影响性能因为只有一个节点.</tm-text>
8
+ </view>
9
+ </tm-sheet>
10
+
11
+ <tm-sticky-header>
12
+ <tm-sheet color="success" height="44px" :margin="[24, 0]" :padding="[24, 0]"
13
+ class="flex flex-row flex-row-center-start">
14
+ <tm-text color="white" font-size="28" class="text-weight-b d-block ">滑动我被悬浮</tm-text>
15
+ </tm-sheet>
16
+ </tm-sticky-header>
17
+ <tm-sheet margin="24" :height="150"></tm-sheet>
18
+
19
+ <tm-sheet :margin="24">
20
+ <tm-text font-size="28" class="text-weight-b d-block ">通过修改偏移量保持在上个下方</tm-text>
21
+ </tm-sheet>
22
+ <tm-sticky-header top="44px">
23
+ <tm-sheet color="primary" height="44px" :margin="[24, 0]" :padding="[24, 0]"
24
+ class="flex flex-row flex-row-center-start">
25
+ <tm-text font-size="28" color="white" class="text-weight-b d-block ">我会在上个悬浮下方</tm-text>
26
+ </tm-sheet>
27
+ </tm-sticky-header>
28
+ <tm-sheet margin="24" height="150"></tm-sheet>
29
+ <tm-sticky-header>
30
+ <tm-sheet color="error" height="44px" :margin="[24, 0]" :padding="[24, 0]"
31
+ class="flex flex-row flex-row-center-start">
32
+ <tm-text font-size="28" color="white" class="text-weight-b d-block ">我会盖住第一个上方</tm-text>
33
+ </tm-sheet>
34
+ </tm-sticky-header>
35
+
36
+ <view style="height: 1500px;"></view>
37
+ </tm-sticky>
38
+ </view>
39
+ </template>
40
+
41
+ <script lang="ts" setup>
42
+ import { ref } from 'vue';
43
+
44
+ </script>
45
+
46
+ <style></style>
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class="text-weight-b mb-8">左滑菜单 SwitchSlider</tm-text>
5
+ <tm-text class="" color="#999999"> 通过插槽可完全自定义布局,自由度非常高。如果子菜单无法定宽或者被挤夺请写style:flex-shrink: 0;避免。 </tm-text>
6
+ </tm-sheet>
7
+ <tm-sheet :padding="['0px']" class="overflow">
8
+ <tm-switch-slider
9
+ :status="item.opened"
10
+ @open="onopen(index)"
11
+ @close="onclose(index)"
12
+ height="116"
13
+ @disabledScrollChange="disablechange"
14
+ @click="onclick(index)"
15
+ v-for="(item, index) in testList"
16
+ :key="index"
17
+ :disabled="item.disabled"
18
+ >
19
+ <tm-cell
20
+ round="0"
21
+ tbPadding="16"
22
+ minHeight="100"
23
+ :showBottomBorder="false"
24
+ :card="false"
25
+ :title="item.title"
26
+ :desc="item.subtext"
27
+ ></tm-cell>
28
+ <template #menu>
29
+ <view class="flex flex-row flex-row-center-end" style="height: 100%">
30
+ <view @click="share" class="flex flex-row flex-row-center-center" style="width: 110px; background: black; height: 100%">
31
+ <text class="text-white">分享</text>
32
+ </view>
33
+ <view @click="remvoe" class="flex flex-row flex-row-center-center" style="width: 110px; background: red; height: 100%">
34
+ <text class="text-white">删除</text>
35
+ </view>
36
+ </view>
37
+ </template>
38
+ </tm-switch-slider>
39
+ </tm-sheet>
40
+ </view>
41
+ </template>
42
+
43
+ <script lang="ts" setup>
44
+ import { ref, onMounted } from 'vue'
45
+
46
+ const testList = ref<
47
+ {
48
+ title: string
49
+ subtext: string
50
+ disabled: boolean
51
+ opened: boolean
52
+ }[]
53
+ >([])
54
+ const closeAll = () => {
55
+ let oldlist = testList.value.slice(0)
56
+ oldlist = oldlist.map((el, from: number) => {
57
+ el.opened = false
58
+ return el
59
+ })
60
+ testList.value = oldlist.slice(0)
61
+ }
62
+ const onopen = (index: number) => {
63
+ let oldlist = testList.value.slice(0)
64
+ oldlist = oldlist.map((el, from: number) => {
65
+ if (from != index) {
66
+ el.opened = false
67
+ } else {
68
+ el.opened = true
69
+ }
70
+ return el
71
+ })
72
+ testList.value = oldlist.slice(0)
73
+ }
74
+ const onclose = (index: number) => {
75
+ console.log(index)
76
+ }
77
+ const disablechange = () => {
78
+ console.log('disablechange')
79
+ }
80
+ const onclick = (index: number) => {
81
+ console.log(index, '--')
82
+ closeAll()
83
+ }
84
+ const share = () => {
85
+ console.log('share')
86
+ uni.showToast({
87
+ title: '分享',
88
+ icon: 'success'
89
+ })
90
+ closeAll()
91
+ }
92
+ const remvoe = () => {
93
+ console.log('remvoe')
94
+ uni.showToast({
95
+ title: '删除',
96
+ icon: 'success'
97
+ })
98
+ closeAll()
99
+ }
100
+
101
+ onMounted(() => {
102
+ for (let i = 0; i < 6; i++) {
103
+ testList.value.push({
104
+ title: '标题' + i,
105
+ subtext: i == 1 ? '被禁用' : '描述' + i,
106
+ disabled: i == 1,
107
+ opened: false
108
+ })
109
+ }
110
+ })
111
+ </script>
112
+
113
+ <style lang="scss"></style>
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class=" text-weight-b d-block">开关 tmSwitch</tm-text>
5
+ <tm-text class="" color="#999999">样式可全局配置,统一修改风格</tm-text>
6
+ </tm-sheet>
7
+ <tm-sheet class="flex flex-row gap-10">
8
+ <tm-switch size="small"></tm-switch>
9
+ <tm-switch ></tm-switch>
10
+ <tm-switch @change="onchange" v-model="kaiguan" size="large"></tm-switch>
11
+ </tm-sheet>
12
+
13
+ <tm-sheet>
14
+ <tm-text font-size="36" class="text-weight-b mb-n8">显示内文字</tm-text>
15
+ <tm-sheet padding="0" margin="0" class="flex flex-row gap-10">
16
+ <tm-switch :label='["开", "关"]'></tm-switch>
17
+ <tm-switch :label='["ON", "OFF"]'></tm-switch>
18
+ </tm-sheet>
19
+ </tm-sheet>
20
+
21
+
22
+ <tm-sheet>
23
+ <tm-text font-size="36" class="text-weight-b mb-n8">修改颜色</tm-text>
24
+ <tm-sheet padding="0" margin="0" class="flex flex-row gap-10">
25
+ <tm-switch :modelValue="true" color="danger"></tm-switch>
26
+ <tm-switch :modelValue="true" color="success"></tm-switch>
27
+ <tm-switch :modelValue="true" color="error"></tm-switch>
28
+ </tm-sheet>
29
+ </tm-sheet>
30
+
31
+
32
+ <tm-sheet>
33
+ <tm-text font-size="36" class="text-weight-b mb-n8">状态</tm-text>
34
+ <tm-sheet padding="0" margin="0" class="flex flex-row gap-10">
35
+ <tm-switch :modelValue="true" :disabled="true"></tm-switch>
36
+ <tm-switch :modelValue="true" :loading="true"></tm-switch>
37
+ </tm-sheet>
38
+ </tm-sheet>
39
+
40
+
41
+ <tm-sheet>
42
+ <tm-text font-size="36" class="text-weight-b mb-n8">圆角风格,及修改间隙</tm-text>
43
+ <tm-sheet padding="0" margin="0" class="flex flex-row gap-10">
44
+ <tm-switch round="4" space="6px"></tm-switch>
45
+ <tm-switch round="6" ></tm-switch>
46
+ </tm-sheet>
47
+ </tm-sheet>
48
+
49
+
50
+ <view class="py-20"></view>
51
+ </view>
52
+ </template>
53
+
54
+ <script lang="ts" setup>
55
+ import { ref } from "vue";
56
+ const kaiguan = ref(false)
57
+ const onchange = (open: boolean) => {
58
+
59
+ }
60
+ </script>
61
+
62
+ <style></style>
@@ -0,0 +1,41 @@
1
+ <!--
2
+ - Copyright (c) 2025. tmzdy by @https://tmui.design
3
+ -->
4
+
5
+ <script lang="ts" setup>
6
+ import { ref } from 'vue';
7
+
8
+ const outIndex = ref(2)
9
+ const list: TM.TABBAR_ITEM_INFO[] = [
10
+ { title: '首页', icon: 'home-smile-2-line', selectedIcon: 'home-smile-2-fill', dotType: 'dot' },
11
+ { title: '分类', icon: 'cloud-line', selectedIcon: 'cloud-fill' },
12
+ { title: '购物车', icon: 'shopping-basket-line', selectedIcon: 'shopping-basket-fill' },
13
+ { title: '统计数据', icon: 'bar-chart-2-line', selectedIcon: 'bar-chart-2-fill', dotLabel: '99+' },
14
+ { title: '我的', icon: 'group-line', selectedIcon: 'group-fill' }
15
+ ]
16
+ </script>
17
+
18
+ <template>
19
+
20
+ <tm-sheet >
21
+ <tm-text font-size="36" class="text-weight-b d-block">底部导航 TmTabbar</tm-text>
22
+ <view class="mb-n8">
23
+ <tm-text>可以设置凸起,也可以关闭,用于底部导航使用,多页面导航等。</tm-text>
24
+ </view>
25
+ <tm-button block @click="outIndex = 3">切换outIndex</tm-button>
26
+ </tm-sheet>
27
+ <tm-tabbar
28
+ :list="list"
29
+ :outIndex="outIndex"
30
+ color="rgba(0,0,0,0.64)"
31
+ out-bg-color="#000000"
32
+ out-icon-color="#eeeeee"
33
+ position="fixed"
34
+ selected-color="#000000"
35
+ >
36
+ </tm-tabbar>
37
+ </template>
38
+
39
+ <style scoped>
40
+
41
+ </style>
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ import { ref, computed, onMounted, watch, PropType } from 'vue';
3
+ const data2 = ref(['待配送', '售后中', { id: 'tmui', title: '待收款', dot: 'hot' }])
4
+ const data3 = ref(['待配送', { id: 'tmui', title: '待收款', dot: 22 }, '售后中'])
5
+ const data = ref(['全部',{title:'禁用项',disabled:true}, { id: 'tmui', title: '待收款', dot: 'hot' }, '待配送', '售后中', { title: '已退款', dot: 3 }, '待配送', '售后中', '已退款'])
6
+
7
+ </script>
8
+ <template>
9
+ <view>
10
+ <tm-sheet :margin="['0', '0', 0, 20]">
11
+ <tm-text font-size="36" class=" text-weight-b mb-16 d-block">标签导航 tmTabs</tm-text>
12
+ <tm-text class="" color="#999999">tabs标签导航组件,样式非常丰富可以完成你想要的自定义样式.</tm-text>
13
+ </tm-sheet>
14
+ <tm-tabs :list="data"></tm-tabs>
15
+ <tm-sheet :margin="['0', '20', 0, 20]">
16
+ <tm-text font-size="36" class="text-weight-b">均分</tm-text>
17
+ </tm-sheet>
18
+ <tm-tabs item-width="33.33%" :list="data2"></tm-tabs>
19
+ <tm-sheet :margin="['0', '20', 0, 20]">
20
+ <tm-text font-size="36" class="text-weight-b">均分线等宽修改激活色</tm-text>
21
+ </tm-sheet>
22
+ <tm-tabs item-width="33.33%" gap="0" line-full line-height="2px" active-title-color="warn"
23
+ :list="data2"></tm-tabs>
24
+ <tm-sheet :margin="['0', '20', 0, 20]">
25
+ <tm-text font-size="36" class="text-weight-b">自定背景相关</tm-text>
26
+ </tm-sheet>
27
+ <tm-tabs item-width="33.33%" gap="0" line-full line-height="2px" color="primary" dot-bg-color="warn"
28
+ title-color="#acdaff" active-title-color="white" :list="data3"></tm-tabs>
29
+ <tm-sheet :margin="['0', '20', 0, 20]">
30
+ <tm-text font-size="36" class="text-weight-b">使用自定style完全覆盖样式</tm-text>
31
+ </tm-sheet>
32
+ <tm-tabs
33
+ custom-item-style="color:#000;"
34
+ active-item-style="background:#f5f5f5"
35
+ :list="data"></tm-tabs>
36
+ </view>
37
+ </template>
38
+ <style scoped>
39
+ .tmTabsWrapBox {
40
+ display: flex;
41
+ flex-direction: row;
42
+ flex-wrap: nowrap;
43
+ width: 200px;
44
+ height: 44px;
45
+ }
46
+ </style>
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <view>
3
+ <tm-sheet>
4
+ <tm-text font-size="36" class="text-weight-b mt-16">标签 TmTag</tm-text>
5
+ <view class="">
6
+ <tm-text>样式丰富塑造性好。</tm-text>
7
+ </view>
8
+ </tm-sheet>
9
+
10
+ <tm-sheet>
11
+ <tm-text font-size="36" class="text-weight-b mb-n8">大小</tm-text>
12
+ <view class="flex flex-row flex-row-top-start flex-wrap gap-15 mt-16">
13
+ <tm-tag size="xs">极小</tm-tag>
14
+ <tm-tag size="s">小</tm-tag>
15
+ <tm-tag size="m">中等</tm-tag>
16
+ <tm-tag>默认</tm-tag>
17
+ <tm-tag size="g">大标签</tm-tag>
18
+ </view>
19
+ </tm-sheet>
20
+
21
+ <tm-sheet>
22
+ <tm-text font-size="36" class="text-weight-b flex d-block mb-n8">状态及样式</tm-text>
23
+ <view class="flex flex-row flex-row-top-start flex-wrap gap-15">
24
+ <tm-tag :disabled="true">禁用</tm-tag>
25
+ <tm-tag skin="outlined">outlined</tm-tag>
26
+ <tm-tag skin="thin">thin</tm-tag>
27
+ <tm-tag skin="dashed">dashed</tm-tag>
28
+ <tm-tag>normal</tm-tag>
29
+ <tm-tag skin="text">text</tm-tag>
30
+
31
+ </view>
32
+ </tm-sheet>
33
+
34
+ <tm-sheet>
35
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">图标</tm-text>
36
+ <view class="flex flex-row flex-row-top-start flex-wrap gap-15">
37
+ <tm-tag icon="thumb-up-fill" round="42" style="padding: 0 24rpx;">图标</tm-tag>
38
+ <tm-tag icon="reply-line" color="error" size="n">回复</tm-tag>
39
+ <tm-tag icon="verified-badge-fill" skin="outlined" iconSize="52" size="n" btnIcon></tm-tag>
40
+ <tm-tag skin="thin" icon="thumb-up-fill">为您点赞</tm-tag>
41
+ <tm-tag skin="thin" color="info" icon="verified-badge-line">这是一个非常长的小标签</tm-tag>
42
+ <tm-tag skin="outlined" icon="thumb-up-fill">为您点赞</tm-tag>
43
+ <tm-tag skin="dashed" color="success" icon="thumb-up-fill">为您点赞</tm-tag>
44
+
45
+ </view>
46
+ </tm-sheet>
47
+
48
+ <tm-sheet>
49
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">其它自定样式</tm-text>
50
+ <view class="flex flex-wrap gap-15">
51
+ <tm-tag skin="outlined" :round="[20, 0, 20, 0]">加载中</tm-tag>
52
+ <tm-tag skin="dashed" :round="[20, 0, 20, 0]">圆角半径</tm-tag>
53
+ <tm-tag color="#4300B1" :linear="['45deg', '#A531DC', '#4300B1']" :round="[20, 0, 20, 0]">渐变</tm-tag>
54
+ <tm-tag skin="thin">浅色</tm-tag>
55
+ <tm-tag :linear="['to right', '#FFEB3A', '#4DEF8E']">渐变</tm-tag>
56
+ <tm-tag :linear="['to right', '#FFC328', '#E20000']">渐变</tm-tag>
57
+ <tm-tag :linear="['to right', '#DD7BFF', '#FF6C6C']">渐变</tm-tag>
58
+
59
+ </view>
60
+ </tm-sheet>
61
+
62
+ </view>
63
+ </template>
64
+
65
+ <script setup lang="ts">
66
+ import { ref } from "vue";
67
+ </script>
68
+
69
+ <style></style>
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <tm-sheet>
3
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">文本 TmText</tm-text>
4
+ <view>
5
+ <tm-text>事实上,如果你没有特殊要求可以不用此组件,用自带的text配合我的css库一样比较方便轻巧</tm-text>
6
+ <tm-text @item-click="testClick" class="line-10" :heightLight="['高亮显示', '正则', '邮箱']"
7
+ label="支持多文本高亮显示,比如根据正则高亮电话号码,邮箱等,点击后打电话,发邮件。"></tm-text>
8
+ </view>
9
+ </tm-sheet>
10
+ <tm-sheet>
11
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">高亮文本,可自定样式</tm-text>
12
+ <view>
13
+ <tm-text>正则电话,邮箱高亮</tm-text>
14
+ <tm-text @item-click="testClick" height-light-color="red" :height-light-reg="[
15
+ '1[3456789]\\d{9}',
16
+ '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}',
17
+ '《(.*?)》',
18
+ ]" label="邮箱等,点击后打电话:17970689633,发邮件:qq@qq.com。高文本可以被点击触《服务隐私协议》发事件,高亮事件触发目《隐私协议》前uniappx 3.99有bug待官方修复.">
19
+ </tm-text>
20
+ </view>
21
+ </tm-sheet>
22
+
23
+ <tm-sheet>
24
+ <tm-text font-size="36" class="text-weight-b mb-n8 d-block">使用插槽功能丢失</tm-text>
25
+ <view>
26
+ <tm-text :lines="2">
27
+ 使用插槽,当作普通text标签使用,高亮功能和后续的拓展将会失效。
28
+ 使用插槽,当作普通text标签使用,高亮功能和后续的拓展将会失效。
29
+ </tm-text>
30
+ </view>
31
+ </tm-sheet>
32
+ </template>
33
+ <script setup lang="ts">
34
+ const testClick = (text: string) => {
35
+ uni.showToast({ title: text, icon: "none" });
36
+ };
37
+ </script>
38
+ <style lang="scss"></style>