vue to execute twice, how to solve
vue to execute twice, how to solve
has also had this problem. Note:
initially thought it was in conflict with fastclick
in the project, but later confirmed that it was not caused by this reason. The
official website Demo does not have a similar problem. Finally, it is temporarily changed to @ touchstart
+ @ touchend.stop.prevent
to simulate @ click
.
sample code:
<template>
<button @touchstart="start($event)" @touchend.stop.prevent="stop($event)">Test</button>
</template>
<script>
export default {
methods: {
start ($event) {
this.startY = $event.touches[0].pageY
},
stop ($event) {
const moving = Math.abs($event.changedTouches[0].pageY - this.startY)
if (moving > 20) return
this.startY = 0
console.log('click')
}
}
}
</script>
problem solved the upstairs method is feasible
@ click.native directly report an error
this method can also be used to trigger 2 clicks
< button Vignon br. Stop.principent= "onClick" > < / button >
Previous: How do I change the files installed by node modules to the project directory in the vue project?
Next: How to accurately remove the double quotation marks after the variable without regularization
as shown in the figure, v-for generates input, in Vue. When the add button is clicked, the cursor automatically focuses on the latest input, window and automatically moves to the appropriate location! ...
the directory structure is as follows: : package.json : packagesindex.js: srcapp.vue solve. ...
<template> <section v-show="bool">11< section> < template> <script> export default { data() { return { bool: false }; }, mounted() { }, methods: { aaa() { let that = this; ...
first of all, the source code is like this input(v-model="num" @keyup="search") -sharp .prompt(v-show="lists!=0") -sharp .list(v-for="(i,n) in lists" :key="n") {{i.name}} how vue listens to let the...
using the nuxt framework, there are two pages An and B A page jumps to b page and transmits product information to B page via url The B page can get the information and copy it to the goodsList in data, but the page cannot render the page according ...
now the interface returns http: 60.10.25.240 api commo., which is a link that you can download as soon as you visit it. You can download it with window.open, and you can t preview it with iframe. By the way, how can you open this online ? Visit and d...
problem description to implement the file download function, you can put the resource url into the a tag, but how to achieve the real-time progress of downloading (for example, a total of 800kb, 321kb downloaded in this second)? looked up some mater...
now you need something exactly the same as the bottom tabbar. All you need is to click on one, change its image and background color to the selected style, and the rest will default. now that I ve done it, I can do this, but the process is really ug...
question: there is a loop where deeplearning is a list of contents similar to [ lstm0 , lstm1 , gru0 ], but the content of the list changes as the user adds, so it is not fixed. I want to dynamically bind to the element of the list 1. I want t...
problem description vue v-if,jsdiv,setAttributev-if, the environmental background of the problems and what methods you have tried create div, dynamically through js, and then bind div to VMI if to add judgment conditions. True and false, can be see...
vue hangs a function in prototype to refresh another page and shows that the call is undefined, but jumping from another page to the called page does not report an error ...
according to iview s official document, table has been changed to i-table, but it still doesn t show the effect specific code: http: jsrun.net MAhKp edit 3 <link rel="stylesheet" type="text css" href="http: unpkg.com...
according to iview s official document, table has been changed to i-table, but it still doesn t show the effect specific code: http: jsrun.net MAhKp edit 3 <link rel="stylesheet" type="text css" href="http: unpkg.com...
for example, is calling their encapsulated method the same as before? Encapsulate the method, and then write their encapsulated method in the method? what would a natively written method look like? ...
1. At present, the function you want to achieve is to select all the tables by default after the page has loaded multiple tables. Now ref is set up in every table created() "vod_table " Gods, ask for advice ...
A takeout software, using element-ui, the order is displayed with el-table, and each column of the table shows the name, quantity, and total price of the goods. Now you want to achieve: when you use el-input-number to dynamically modify the quantity, th...