简体   繁体   English

v-on Click 对引导模式按钮不起作用

[英]v-on Click not working for bootstrap modal button

Bootstrap modal is linked with a button.引导模式与按钮链接。 I want to get some data on click.我想在点击时获得一些数据。 But the bootstrap default event is not letting the v-on:click event to trigger.但是引导默认事件不会让v-on:click事件触发。 Any help will be appreciated.任何帮助将不胜感激。

<a data-id="{{ $order->id }}" data-toggle="modal" class="changeartwork" data-target="#uploadModal" @click="getData()">Upload</a>

Use: v-on:click.prevent.stop="getData()" instead.使用: v-on:click.prevent.stop="getData()"代替。 This will stop the on click bubbling up to Bootstrap and overriding it.这将停止点击冒泡到 Bootstrap 并覆盖它。

See here for more info: https://v2.vuejs.org/v2/guide/events.html#Event-Modifiers有关更多信息,请参见此处: https ://v2.vuejs.org/v2/guide/events.html#Event-Modifiers

Note: It's possible that .prevent would be enough but without a test case, I'm not sure so just give it a go and see which works.注意: .prevent可能就足够了,但如果没有测试用例,我不确定,所以试一试,看看哪个有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM