#
whycq
2022-09-23 d170cf41d68bbb82179fae1b2332a315465ef93b
components/y-input/y-input.vue
@@ -3,7 +3,8 @@
      <view class="main">
         <view class="title item-height">{{titleText}}</view>
         <view class="input item-height">
            <input type="text" :placeholder="placeholderText" placeholder-style="font-size:28rpx" v-model="val">
            <input type="text" :placeholder="placeholderText" @input="input"
            placeholder-style="font-size:28rpx" v-model="val">
         </view>
      </view>
   </view>
@@ -17,10 +18,18 @@
            type: String,
            default: ''
         },
         inputVal: {
            type: String,
         value: {
            type: [String, Number],
            default: ''
         }
      },
      watch: {
         value(val) {
            this.val = val
         },
      },
      created() {
         this.val = this.value
      },
      computed: {
         titleText() {
@@ -37,6 +46,11 @@
         return {
            val:''
         };
      },
      methods: {
         input() {
            this.$emit('input',this.val);
         }
      }
   }
</script>