<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>让元素事件只执行一次事件,就可以使用once </title> <script src="vue.js"></script> </head> <body> <div id="hdcms"> <div> <a href="https://www.baidu.com/" @click.stop.prevent.once="links">百度</a> </div> </div> <script> var app = new Vue({ el: '#hdcms', data: { times: new Date() }, methods: { links() { alert("百度一下"); } } }); </script> </body> </html>