用于设置点击事件由鼠标哪个按键来完成。

    ·.left 修饰符

    ·.right 修饰符

    ·.middle修饰符

    <!DOCTYPE html> <html lang=“en”> <head> <meta charset=“UTF-8”> <meta name=“viewport” content=“width=device-width, initial-scale=1.0”> <title>Document</title> </head> <body> <div id=“app”> <button @click.left=“fn”>按钮1</button> <button @click.right=“fn”>按钮2</button> <button @click.middle=“fn”>按钮3</button> </div> <script src=“lib/vue.js”></script> <script> new Vue({ el: ‘#app’, data: { }, methods: { fn() { console.log(‘点击了元素’); } } }); </script> </body> </html>