Closed mohammad-zr closed 1 year ago
How to call a function after calling originalMethod.apply(this, args) in a custom decorator?
originalMethod.apply(this, args)
import { createDecorator } from 'vue-class-component' export const Log = createDecorator((options, key) => { const originalMethod = options.methods[key] options.methods[key] = function wrapperMethod(...args) { console.log('BEFORE') originalMethod.apply(this, args) console.log('AFTER') // I want this but not called } })
How to call a function after calling
originalMethod.apply(this, args)
in a custom decorator?