uni-app null is not an object (evaluating 'this.$emit') __ERROR

created at 08-23-2021 views: 2

description

Use this.$emit in uni-app components

Write directly in @click="this.$emit(‘"voucherChange",{item,index}))" will report an error

uni-app null is not an object (evaluating'this.$emit') __ERROR

solution

@click="voucherChange(item,index)"

write in methods:

voucherChange(item,index){
  this.$emit('voucherChange',{item,index})
}
created at:08-23-2021
edited at: 08-23-2021: