index.vue 950 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="box">
  3. <Nav title="首页"></Nav>
  4. <enInput v-model="text" name="用户姓名"></enInput>
  5. <enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>
  6. </view>
  7. </template>
  8. <script>
  9. import enInput from "components/en-input/en-input"
  10. import enSend from "components/en-send/en-send"
  11. export default {
  12. components: {
  13. enInput,
  14. enSend
  15. },
  16. data() {
  17. return {
  18. phone:'13900139001',
  19. text:'asdsa',
  20. }
  21. },
  22. watch:{
  23. 'phone':function (){
  24. console.log('new--------'+this.phone)
  25. },
  26. 'text':function (){
  27. console.log('new--------'+this.text)
  28. }
  29. },
  30. mounted() {
  31. },
  32. methods: {
  33. getCode(){
  34. console.log('---------------------asdsa')
  35. this.text='abc'
  36. this.$refs.enSendObj.setCodeNum()
  37. },
  38. },
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .box{
  43. padding: 32rpx 32rpx 0;
  44. background-color: #fff;
  45. }
  46. </style>