<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="vue3.js"></script> </head> <body> <div id="app"> //单机 <p @click="foo('hulanxi1')">{{msg}}</p> //双击 <p @dblick="foo('hulanxi2')">{{msg}}</p> </div> <script> // 数据驱动界面 var vm = Vue.createApp({ data(){ return { msg:"huchangxi" } }, methods: { foo(name){ this.msg = name; } }, }).mount("#app") </script> </body> </html>