浏览代码

fix(input): 组件透传属性移动至原生标签上

eiinu 2 年之前
父节点
当前提交
3b8746bb94
共有 1 个文件被更改,包括 3 次插入8 次删除
  1. 3 8
      src/packages/__VUE/input/index.taro.vue

+ 3 - 8
src/packages/__VUE/input/index.taro.vue

@@ -8,6 +8,7 @@
         <view class="nut-input-box">
           <component
             :is="renderInput(type)"
+            v-bind="$attrs"
             class="input-text"
             ref="inputRef"
             :style="styles"
@@ -41,14 +42,7 @@
           v-show="(active || showClearIcon) && modelValue.length > 0"
         >
           <slot name="clear">
-            <MaskClose
-              class="nut-input-clear"
-              v-bind="$attrs"
-              :size="clearSize"
-              :width="clearSize"
-              :height="clearSize"
-              @click="clear"
-            >
+            <MaskClose class="nut-input-clear" :size="clearSize" :width="clearSize" :height="clearSize" @click="clear">
             </MaskClose>
           </slot>
         </view>
@@ -81,6 +75,7 @@ export interface InputTarget extends HTMLInputElement {
 }
 
 export default create({
+  inheritAttrs: false,
   props: {
     type: {
       type: String as PropType<InputType>,