vue switching pull-down page content, real-time transmission to the background (the triggering event input content changes)

Triggering event 1.input content changes
https://www.cnblogs.com/littlesummer/p/6428116.html
2.
JavaScript event listeners input input

<body>
	<input type="text" id="myInput" oninput="inputFunction()">
	<p id="demo"></p>
	<script>
		function inputFunction( ) {
			let o = document.getElementById("myInput").value
			document.getElementById("demo").innerHTML = "你输入的是 :"  + o; 
		}
	</script>
</body>

Here Insert Picture Description

input input event listeners in Vue

<input type="text" id="myInput" @input="inputFunction()">
<p id="demo"> </p>
methods:{
	inputFunction(){
		let o = document.getElementById("myInput").value
		document.getElementById("demo").innerHTML = "你输入的是 :"  + o; 
	}
}

Reprinted added: I use is this part of the code, let me back in time drop-down box to switch content, real-time call form interface. We params: reference to the background, as the code this $ http.adornParams ({}) in the transmission, I'll 'o' back pass. @input to monitor the method call interface

Here Insert Picture Description
Note that
in vue, the monitor input input event, using the v-on instruction.
v-on: input = "func " or abbreviated as @input = "func"

Original link: https://blog.csdn.net/StephenO_o/article/details/84316779

Published 38 original articles · won praise 1 · views 5162

Guess you like

Origin blog.csdn.net/ShangMY97/article/details/103888415