lilei 4 maanden geleden
bovenliggende
commit
e8707d6928
2 gewijzigde bestanden met toevoegingen van 4 en 9 verwijderingen
  1. 1 0
      components/chunLei-popups/chunLei-popups.vue
  2. 3 9
      components/m-input.vue

+ 1 - 0
components/chunLei-popups/chunLei-popups.vue

@@ -14,6 +14,7 @@
 
 <script>
 	export default{
+		emits: ["update:modelValue", "input", "tapPopup"],
 		props:{
 			maskBg:{
 				type:String,

+ 3 - 9
components/m-input.vue

@@ -3,7 +3,7 @@
 		<input 
 		:focus="focus" 
 		:type="inputType == 'password' ? 'text' : inputType"
-		:value="value" 
+		:value="modelValue" 
 		@input="onInput" 
 		class="m-input-input" 
 		:placeholder="placeholder"
@@ -12,7 +12,7 @@
 		 @focus="onFocus" 
 		 @blur="onBlur" />
 		<!-- 优先显示密码可见按钮 -->
-		<view v-if="clearable&&!displayable&&value.length" class="m-input-icon">
+		<view v-if="clearable&&!displayable&&modelValue.length" class="m-input-icon">
 			<uni-icons color="#666666" type="clear" @click="clear"></uni-icons>
 		</view>
 		<view v-if="displayable" class="m-input-icon">
@@ -26,6 +26,7 @@
 
 <script>
 	export default {
+		emits: ["update:modelValue", "input", "change", "confirm", "clear", "blur", "focus", "click", "touchstart"],
 		props: {
 			/**
 			 * 输入类型
@@ -34,7 +35,6 @@
 			/**
 			 * 值
 			 */
-			value: String,
 			modelValue:String,
 			/**
 			 * 占位符
@@ -66,10 +66,6 @@
 				default: -1
 			}
 		},
-		model: {
-			prop: 'value',
-			event: 'input'
-		},
 		data() {
 			return {
 				/**
@@ -90,7 +86,6 @@
 		},
 		methods: {
 			clear() {
-				this.$emit('input', '')
 				this.$emit('update:modelValue','')
 			},
 			onFocus() {
@@ -102,7 +97,6 @@
 				})
 			},
 			onInput(e) {
-				this.$emit('input', e.detail.value)
 				this.$emit('update:modelValue',e.detail.value)
 			}
 		}