wangxiaowei 4ee2cd1a45 修改代码
2025-11-10 17:30:34 +08:00
2025-09-26 17:04:39 +08:00
2025-09-24 12:52:45 +08:00
2025-10-16 16:26:57 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-11-10 17:30:34 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-10-25 17:33:08 +08:00
2025-09-24 12:52:45 +08:00
2025-10-25 17:33:08 +08:00
2025-09-24 12:52:45 +08:00
2025-10-16 16:26:57 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00
2025-09-24 12:52:45 +08:00

茶址

使用Unibest开发版本号3.8.2

开发规范

1. 页面或组件添加方法的时候前面加上handle关键字除了插件相关内容如mescroll

	handleConfirmHour: () => {
		if (totalHour.value <= 0) {
			toast.info('至少起订N小时')
			return
		}
		showReservePopup.value = false
	},

2. 页面或组件传创建的方法需要以当前文件名称作为对象按照驼峰命名

	const Detail = {
		handleConfirmHour: () => {
			if (totalHour.value <= 0) {
				toast.info('至少起订N小时')
				return
			}
			showReservePopup.value = false
		}
	} 

3. 页面或组件传创建的内部方法需要放在函数最下面这种方法前面不需要加上handle

	const Detail = {
		handleConfirmHour: () => {
			if (totalHour.value <= 0) {
				toast.info('至少起订N小时')
				return
			}
			showReservePopup.value = false
		},

		// 格式化时间
		formatDate: (timestamp: number) => {
			const date = new Date(timestamp)
			const year = date.getFullYear()
			const month = String(date.getMonth() + 1).padStart(2, '0')
			const day = String(date.getDate()).padStart(2, '0')
			const hour = String(date.getHours()).padStart(2, '0')
			const minute = String(date.getMinutes()).padStart(2, '0')

			return `${year}-${month}-${day} ${hour}:${minute}`
		}
	} 

4. 如果组件名称与定义的对象函数名冲突则对象函数名后面加上s

    import coupon from '@/components/coupon/coupon.vue'
	const Coupons = {
		handleConfirmHour: () => {
			if (totalHour.value <= 0) {
				toast.info('至少起订N小时')
				return
			}
			showReservePopup.value = false
		},

		// 格式化时间
		formatDate: (timestamp: number) => {
			const date = new Date(timestamp)
			const year = date.getFullYear()
			const month = String(date.getMonth() + 1).padStart(2, '0')
			const day = String(date.getDate()).padStart(2, '0')
			const hour = String(date.getHours()).padStart(2, '0')
			const minute = String(date.getMinutes()).padStart(2, '0')

			return `${year}-${month}-${day} ${hour}:${minute}`
		}
	}

5. 组件名称需按照PascalCase来写

   import UserProfile from './components/UserProfile.vue';
   在页面模板中按照 <user-profile></user-profile>来使用
Description
No description provided
Readme MIT 1.9 MiB
Languages
Vue 85%
TypeScript 7.1%
JavaScript 5.9%
CSS 1.2%
SCSS 0.8%