Skip to content

Reset content after scan (on "unPause") #8

@gewra

Description

@gewra

Awesome component, thanks!

However I would like the option to redeem the same code again (in my case after it has been paused), something that isn't possible at the moment because of:

watch: {
    content (newValue) {
      this.$emit('decode', newValue)
    },
   ...
}

Since this.content isn't updated once it's set

A solution might be to add an 'resetOnUnpause'-prop and add 'paused' to 'watch':

props: {
     ...,
    resetOnUnpause : {
      type: Boolean,
      default: false,
    },
  }

watch: {
   paused(newValue) {
      if (this.resetOnUnpause && !newValue)
         this.content = null
   }
}

Is this something you might be willing to add or should I contribute myself?

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions