index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view class="box">
  3. <Nav title="首页"></Nav>
  4. <enInput v-model="text" label="用户姓名"></enInput>
  5. <enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>
  6. <enCheckbox v-model="type" label="用户爱好" :checkboxData="checkboxData"></enCheckbox>
  7. </view>
  8. </template>
  9. <script>
  10. import enInput from "components/en-input/en-input"
  11. import enSend from "components/en-send/en-send"
  12. import enCheckbox from "components/en-checkbox/en-checkbox"
  13. export default {
  14. components: {
  15. enCheckbox,
  16. enInput,
  17. enSend
  18. },
  19. data() {
  20. return {
  21. phone:'13900139001',
  22. text:'asdsa',
  23. type:[],
  24. // 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':'乒乓球'}]
  25. checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'}]
  26. }
  27. },
  28. watch:{
  29. 'type':function (){
  30. console.log('new--------type',this.type)
  31. },
  32. 'phone':function (){
  33. console.log('new--------'+this.phone)
  34. },
  35. 'text':function (){
  36. console.log('new--------'+this.text)
  37. }
  38. },
  39. mounted() {
  40. },
  41. methods: {
  42. getCode(){
  43. console.log('---------------------asdsa')
  44. this.text='abc'
  45. this.$refs.enSendObj.setCodeNum()
  46. },
  47. },
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .box{
  52. padding: 32rpx 32rpx 0;
  53. background-color: #fff;
  54. }
  55. </style>