index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="en-box">
  3. <input type="number" class="en-input sys-size-32 " placeholder="请输入手机号" maxlength="11" placeholder-class="sys-size-28 " v-model="loginData.phone"></input>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name:'en-input',
  9. props: {
  10. type: {
  11. type: String,
  12. default: 'text'
  13. },
  14. placeholder: {
  15. type: String,
  16. default: '请输入'
  17. },
  18. disabled: {
  19. default: false
  20. },
  21. name: {
  22. type: String,
  23. default: 'text'
  24. },
  25. value: {
  26. default: ''
  27. },
  28. maxlength:{
  29. default:140
  30. }
  31. },
  32. data() {
  33. return {
  34. inputValue: '',
  35. };
  36. },
  37. watch: {
  38. 'value': function () {
  39. if (this.inputValue !== this.value) {
  40. this.inputValue = this.value
  41. }
  42. },
  43. 'inputValue': function () {
  44. this.$emit('input', this.inputValue)
  45. }
  46. },
  47. mounted() {
  48. this.inputValue = this.value
  49. },
  50. methods: {
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. .en-input{
  56. .en-input{
  57. width: 100%;
  58. }
  59. .en-input-placeholder{
  60. color: #999999;
  61. font-size: 28rpx;
  62. }
  63. }
  64. </style>