quanyawei
2024-06-18 15fb2702039aae1a297b8f1584e24f228ae1994d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<template>
  <div class="content">
    <div>
      <h1 style="margin-left: 1%; font-size: 22px">在线留言</h1>
      <div style="width: 100%; background: #eee; padding: 15px; font-size: 14px">
        请在此留下您的问题,我们将及时与您取得联系,谢谢您的留言!
      </div>
    </div>
    <div style="margin-top: 10px">
      <el-form :model="formInline" label-width="100px">
        <el-row :gutter="30">
          <el-col :span="8">
            <el-form-item label="联系人:">
              <el-input label="large" v-model="formInline.user" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系电话:">
              <el-input label="large" v-model="formInline.phone" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="电子邮箱:">
              <el-input v-model="formInline.email" label="large" clearable />
            </el-form-item>
          </el-col>
        </el-row>
 
        <div>
          <el-form-item label="留言内容:">
            <el-input v-model="formInline.date" label="large" type="textarea" style="width: 100%" />
          </el-form-item>
        </div>
        <div style="text-align: center; margin-bottom: 50px">
          <el-button type="info" @click="onSubmit">提交内容</el-button>
          <el-button type="info" @click="resetForm">重新填写</el-button>
        </div>
      </el-form>
    </div>
  </div>
</template>
 
<script setup lang="ts">
import { reactive } from 'vue'
import { ElMessage } from 'element-plus'
const formInline = reactive({
  user: '',
  phone: '',
  email: '',
  date: ''
})
 
const onSubmit = () => {
  ElMessage({
    message: '提交成功!',
    type: 'success'
  })
}
const resetForm = () => {
  formInline.user = ''
  formInline.email = ''
  formInline.phone = ''
  formInline.date = ''
}
</script>
 
<style scoped>
.content {
  margin-top: 50px;
  width: 1270px;
  margin: 0 auto;
}
h1 {
  margin-top: 20px;
  margin-bottom: 10px;
}
</style>