index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="box-data">
  3. <Nav title="首页"></Nav>
  4. <view class="border-item"></view>
  5. <enInput v-model="text" label="姓名"></enInput>
  6. <enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>
  7. <enCheckbox v-model="type" label="爱好" :checkboxData="checkboxData"></enCheckbox>
  8. <enRadio v-model="sex" label="性别" :radioData="radioData"></enRadio>
  9. <enSwitch v-model="status" label="状态" ></enSwitch>
  10. <enTextarea v-model="content" label="个人简介"></enTextarea>
  11. <enDate v-model="birthday" type="datetime" label="生日"></enDate>
  12. </view>
  13. </template>
  14. <script>
  15. import enInput from "components/en-input/en-input"
  16. import enSend from "components/en-send/en-send"
  17. import enCheckbox from "components/en-checkbox/en-checkbox"
  18. import enRadio from "components/en-radio/en-radio"
  19. import enSwitch from "components/en-switch/en-switch"
  20. import enTextarea from "components/en-textarea/en-textarea"
  21. import enDate from "components/en-date/en-date"
  22. export default {
  23. components: {
  24. enDate,
  25. enTextarea,
  26. enSwitch,
  27. enRadio,
  28. enCheckbox,
  29. enInput,
  30. enSend
  31. },
  32. data() {
  33. return {
  34. phone:'13900139001',
  35. birthday:'',
  36. text:'来自火星的你',
  37. content:'你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?',
  38. type:['1'],
  39. sex:'1',
  40. status:1,
  41. // checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'},{'id':'4','name':'羽毛球'},{'id':'5','name':'乒乓球'},{'id':'6','name':'铅球'},{'id':'7','name':'棒球'},{'id':'8','name':'冰球'},{'id':'9','name':'网球'},{'id':'10','name':'乒乓球'}]
  42. checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'}],
  43. radioData:[{'id':'1','name':'男'},{'id':'2','name':'女'}]
  44. }
  45. },
  46. watch:{
  47. 'birthday':function (){
  48. console.log('new--------birthday',this.birthday)
  49. },
  50. 'content':function (){
  51. console.log('new--------content',this.content)
  52. },
  53. 'type':function (){
  54. console.log('new--------type',this.type)
  55. },
  56. 'phone':function (){
  57. console.log('new--------'+this.phone)
  58. },
  59. 'text':function (){
  60. console.log('new--------'+this.text)
  61. },
  62. 'status':function (){
  63. console.log('new--------'+this.status)
  64. }
  65. },
  66. mounted() {
  67. },
  68. methods: {
  69. getCode(){
  70. console.log('---------------------asdsa')
  71. this.text='abc'
  72. this.$refs.enSendObj.setCodeNum()
  73. },
  74. },
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .border-item{
  79. border-bottom: 2rpx solid #F0F0F0;
  80. }
  81. .box-data{
  82. padding: 32rpx 32rpx 0;
  83. background-color: #fff;
  84. }
  85. </style>