index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 class="" @click="toList()">进入列表演示</view>
  13. </view>
  14. </template>
  15. <script>
  16. import enInput from "components/en-from/en-input/en-input"
  17. import enSend from "components/en-from/en-send/en-send"
  18. import enCheckbox from "components/en-from/en-checkbox/en-checkbox"
  19. import enRadio from "components/en-from/en-radio/en-radio"
  20. import enSwitch from "components/en-from/en-switch/en-switch"
  21. import enTextarea from "components/en-from/en-textarea/en-textarea"
  22. import enDate from "components/en-from/en-date/en-date"
  23. export default {
  24. components: {
  25. enDate,
  26. enTextarea,
  27. enSwitch,
  28. enRadio,
  29. enCheckbox,
  30. enInput,
  31. enSend
  32. },
  33. data() {
  34. return {
  35. phone:'13900139001',
  36. birthday:'',
  37. text:'来自火星的你',
  38. content:'你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?',
  39. type:['1'],
  40. sex:'1',
  41. status:1,
  42. // 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':'乒乓球'}]
  43. checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'}],
  44. radioData:[{'id':'1','name':'男'},{'id':'2','name':'女'}]
  45. }
  46. },
  47. watch:{
  48. 'birthday':function (){
  49. console.log('new--------birthday',this.birthday)
  50. },
  51. 'content':function (){
  52. console.log('new--------content',this.content)
  53. },
  54. 'type':function (){
  55. console.log('new--------type',this.type)
  56. },
  57. 'phone':function (){
  58. console.log('new--------'+this.phone)
  59. },
  60. 'text':function (){
  61. console.log('new--------'+this.text)
  62. },
  63. 'status':function (){
  64. console.log('new--------'+this.status)
  65. }
  66. },
  67. mounted() {
  68. },
  69. methods: {
  70. getCode(){
  71. console.log('---------------------asdsa')
  72. this.text='abc'
  73. this.$refs.enSendObj.setCodeNum()
  74. },
  75. toList(){
  76. uni.navigateTo({
  77. url:'/pages/text/index'
  78. })
  79. },
  80. },
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .border-item{
  85. border-bottom: 2rpx solid #F0F0F0;
  86. }
  87. .box-data{
  88. padding: 32rpx 32rpx 0;
  89. background-color: #fff;
  90. }
  91. </style>