<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <script src="https://unpkg.com/vue/dist/vue.js"></script> <script src="https://unpkg.com/vuex@3.0.1/dist/vuex.js"></script> <div id="app"> <div> <input v-model="dir1" v-my-directive1="dir1"/> </div> </div> <script> const app = new Vue({ el: '#app', data:{ dir1:'111', dir2:'222' }, directives:{ myDirective1:function(val){ console.log("===="+val) } } }) </script> </body> </html>