index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. </view>
  10. </template>
  11. <script>
  12. import enInput from "components/en-input/en-input"
  13. import enSend from "components/en-send/en-send"
  14. import enCheckbox from "components/en-checkbox/en-checkbox"
  15. import enRadio from "components/en-radio/en-radio"
  16. export default {
  17. components: {
  18. enRadio,
  19. enCheckbox,
  20. enInput,
  21. enSend
  22. },
  23. data() {
  24. return {
  25. phone:'13900139001',
  26. text:'asdsa',
  27. type:[],
  28. sex:'1',
  29. // 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':'乒乓球'}]
  30. checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'}],
  31. radioData:[{'id':'1','name':'男'},{'id':'2','name':'女'}]
  32. }
  33. },
  34. watch:{
  35. 'type':function (){
  36. console.log('new--------type',this.type)
  37. },
  38. 'phone':function (){
  39. console.log('new--------'+this.phone)
  40. },
  41. 'text':function (){
  42. console.log('new--------'+this.text)
  43. }
  44. },
  45. mounted() {
  46. },
  47. methods: {
  48. getCode(){
  49. console.log('---------------------asdsa')
  50. this.text='abc'
  51. this.$refs.enSendObj.setCodeNum()
  52. },
  53. },
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .border-item{
  58. border-bottom: 2rpx solid #F0F0F0;
  59. }
  60. .box-data{
  61. padding: 32rpx 32rpx 0;
  62. background-color: #fff;
  63. }
  64. </style>