index.vue 1.7 KB

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