This commit is contained in:
scout 2025-01-24 11:39:35 +08:00
parent 18395e7841
commit 4a80e4c730

View File

@ -3,7 +3,7 @@
<div class="page">
<div style="margin-top: 350px;">
<van-field v-model="userName" clearable placeholder="请输入姓名">
<van-field v-model="userName" clearable placeholder="请输入姓名" @input="preventSpace">
<template #label>
<div style="color: #E5E5E5;">
预约人姓名
@ -11,7 +11,7 @@
</template>
</van-field>
<van-field style="margin-top: 20px;" v-model="num" clearable placeholder="请输入用餐人数">
<van-field style="margin-top: 20px;" type="number" v-model="num" clearable placeholder="请输入用餐人数">
<template #label>
<div style="color: #E5E5E5;">
用餐人数
@ -147,7 +147,9 @@ const addYuyue = async () => {
showfail.value = true
}
}
const preventSpace = (e) => {
e.target.value = e.target.value.replace(/\s/g, '')
}
const route = useRoute()
const router = useRouter()