0👍
You can check this example:
https://jsfiddle.net/50wL7mdz/39994/
If you use @click.prevent.self
, you can’t click on anything. It prevents all click.
If you use @click.self.prevent
, it only prevents when you click on <a>
element, we can still click on choose file to upload file
- [Vuejs]-Why does `moduleName` in Webpack's stats include '+ 4 modules'?
- [Vuejs]-Vue js and fabric js logic
0👍
Example illustrates difference in chain order
<div id="app">
<a href="https://stackoverflow.com" @click.self.prevent target="_blank">Stackofervlow!
<span :style="{ background: 'yellow', width: '100px', height: '100px' }">span</span>
</a>
</div>
new Vue({
el: '#app'
});
@click.self.prevent
- If you click on span, stackoverflow will open.
- If you click on a, stackoverflow will not open.
@click.prevent
- If you click on span, stackoverflow will not open.
- If you click on a, stackoverflow will not open.
Source:stackexchange.com