问题 How to add directives in nuxt: Note: this is only for client-side 1- /plugins/directives.js: import Vue from 'vue' Vue.directive('getelement', { bind(el, { value: { index, items } }) { el.addEventListener('click', (event) => { event.stopPropagation() console.log(el, index, items) // do whatever }) } }) 2- /nuxt.config.js plugins: [ ... // DIRECTIVES : client ONLY { src: '~/plugins/directives.js', mode: 'client' } ] 3- component.vue <img v-for="(item, index) in items" v-getelement="{ items,