Skip to content
On this page

组件库文档 tmui.design

时间周 Weekbar

显示一行以周为周期的日期选择工具栏,可用于表单录入、日期筛选等场景。


🌶️ 时间周 Weekbar 示例

查看模拟效果
示例模板
vue
<template>
	<tm-app>
		<tm-sheet>
			<tm-text :font-size="24" _class="font-weight-b" label="基础示例,更多见文档"></tm-text>
		</tm-sheet>
		<tm-weekbar></tm-weekbar>
		<tm-weekbar :followTheme="false" activeColor="white" color="red"></tm-weekbar>
		<tm-weekbar :followTheme="false" activeColor="black" color="yellow" linear="bottom"></tm-weekbar>
		<tm-weekbar model="custom" :dayNumber="7"></tm-weekbar>
		
	</tm-app>
</template>
<script lang="ts" setup>
import { ref, computed } from "vue"
import { onShow, onLoad } from "@dcloudio/uni-app";
import tmApp from "@/tmui/components/tm-app/tm-app.vue"
import tmSheet from "@/tmui/components/tm-sheet/tm-sheet.vue"
import tmText from "@/tmui/components/tm-text/tm-text.vue"
import tmWeekbar from "@/tmui/components/tm-weekbar/tm-weekbar.vue"
import tmDivider from "@/tmui/components/tm-divider/tm-divider.vue"
const dateStr = ref('')
const showdate = ref(false)


</script>

🌶️ 兼容性

APP-VUEAPP-NVUE小程序WEB/H5VUE3/TS
✔️✔️✔️✔️✔️

🌱 参数

本组件含有公共属性 公共属性

参数名类型默认值描述
followThemeBooleantrue是否跟随主题
transprentBooleanfalse是否透明效果
roundNumber0圆角 ,0-25
shadowNumber3阴影 ,0-25
defaultValueString,Date,Number''默认日期值,留空为当前日期
modelValueString,Date,Number''选中日期值
colorStringwhite主题颜色
activeColorStringprimary选中颜色

🌹 事件

事件名参数返回数据描述
changedateYYYY-MM-DD选中日期
update:modelValuedateYYYY-MM-DD选中日期(更新v-model值)

🥗 ref方法

💏 文档贡献

此页文档由Kyour贡献,如果对该框架感兴趣的可以参与我们一同进步!