Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after routing to other component no event is triggered #24

Open
tobiasnitschmann opened this issue Feb 7, 2020 · 3 comments
Open

after routing to other component no event is triggered #24

tobiasnitschmann opened this issue Feb 7, 2020 · 3 comments

Comments

@tobiasnitschmann
Copy link

tobiasnitschmann commented Feb 7, 2020

Hi,

i registered the component in the root of my vue app. When i enter the site everything works as expected. but when i change the component via vue-router no event is fired when i scan a barcode.
The trick is to click anywhere on the page and after that the listener works and event is fired again as expected.

Do you have an idea?

@tobiasnitschmann
Copy link
Author

ok, i set the timeout option and it worked.
it seems to be that scanning was performed but not completed. why ever.
by setting the timeout parameter the scanning interval stops and triggers the callback method.

this behavior only occurs after routing to another component.

@ambrooo
Copy link

ambrooo commented Feb 18, 2020

@tobiasnitschmann how did you solve this? I have exact situation here where i move from route to route and after reaching first page after first scan, scan stop listening to event.
I set callbackAfterTimeout to true, but no difference.

@andrew781026
Copy link

andrew781026 commented Feb 26, 2020

change created to mounted , this.$barcodeScanner.destroy() will remove all keypress listener ,

and the destroyed will trigger after created , which make scan not working

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants