猫妈狗爸伴宠师小程序前端代码
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.

78 lines
1.3 KiB

1 month ago
  1. <template>
  2. <view class="base-info">
  3. <view class="form-title">基本信息</view>
  4. <view class="box">
  5. <DForm :list="state.list" @submit="handleSubmit" />
  6. </view>
  7. </view>
  8. </template>
  9. <script setup>
  10. import {
  11. reactive
  12. } from "vue";
  13. import DForm from "@/components/dForm/index.vue"
  14. const state = reactive({
  15. list: [{
  16. type: "input",
  17. label: "姓名",
  18. key: "name",
  19. placeholder: "请输入您的真实姓名",
  20. },
  21. {
  22. type: "input",
  23. label: "身份证号",
  24. key: "idCard",
  25. placeholder: "请输入您的真实身份证号",
  26. },
  27. {
  28. type: "radio",
  29. label: "性别",
  30. key: "sex",
  31. options: [{
  32. name: "男"
  33. },
  34. {
  35. name: "女"
  36. }
  37. ]
  38. },
  39. {
  40. type: "input",
  41. label: "年龄",
  42. key: "gender",
  43. placeholder: "请输入您的年龄",
  44. },
  45. {
  46. type: "input",
  47. label: "养宠经验",
  48. key: "shij",
  49. placeholder: "请输入您的养宠年限",
  50. unit: "年"
  51. },
  52. ]
  53. })
  54. const handleSubmit = (val) => {
  55. console.log("获取参数", val)
  56. }
  57. </script>
  58. <style scoped>
  59. .base-info {
  60. width: 718rpx;
  61. margin: 0 auto;
  62. background-color: #fff;
  63. border-radius: 28rpx;
  64. }
  65. .box {
  66. width: 680rpx;
  67. margin: 0 auto;
  68. background-color: #fff;
  69. padding: 0 36rpx;
  70. box-sizing: border-box;
  71. }
  72. </style>