You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.3 KiB

3 years ago
<template>
<view class="container">
<uni-section title="基本信息" type="line">
<view class="form">
<uni-forms ref="baseForm" :modelValue="form">
<uni-forms-item label="姓名" name="contact" required>
<uni-easyinput v-model="form.contact" placeholder="请输入姓名" />
</uni-forms-item>
<uni-forms-item label="手机号" name="contact" required>
<uni-easyinput v-model="form.contact" placeholder="请输入手机号" />
</uni-forms-item>
</uni-forms>
<button type="primary" @click="submit('valiForm')">提交</button>
</view>
</uni-section>
</view>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
provience: '',
city: '',
industryId: '',
age: '',
introduction: '',
sex: 2,
hobby: [5],
datetimesingle: 1627529992399
}
}
},
onLoad() {
console.log(getApp())
},
methods: {
onchange(e) {
console.log('---------onchange:', e);
},
submit(ref) {
this.$refs[ref].validate().then(res => {
console.log('success', res);
uni.showToast({
title: `校验通过`
})
}).catch(err => {
console.log('err', err);
})
},
}
}
</script>
<style scoped>
.form {
padding: 15px;
background-color: #fff;
}
</style>