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

More consistent, broader compatible Dataset access API #33

Open
dseeker opened this issue Apr 23, 2019 · 0 comments
Open

More consistent, broader compatible Dataset access API #33

dseeker opened this issue Apr 23, 2019 · 0 comments

Comments

@dseeker
Copy link

dseeker commented Apr 23, 2019

The problem occurs in the following line

let id = +(el && el.dataset.throttleId)

Currently the dataset API is used on this line, however just a few lines below the setAttribute method is also used.
el && el.setAttribute('data-throttle-id', id + '')

On some browsers using the dataset api results in mount errors like this:

START WEEX VUE RENDER: 1.0.36, Build 2018-12-29 17:52. 
[Vue Render] install Vue 2.6.10. 
[Vue warn]: Error in beforeCreate hook: "TypeError: Unable to get property 'throttleId' of undefined or null reference" (found in <Root>) 
TypeError: Unable to get property 'throttleId' of undefined or null reference 
[Vue warn]: Error in mounted hook: "TypeError: Unable to get property 'throttleId' of undefined or null reference" (found in <Root>) 
TypeError: Unable to get property 'throttleId' of undefined or null reference 

I suggest replacing dataset with getAttribute method to be more universally compatible and consistent.

from let id = +(el && el.dataset.throttleId)
to let id = +(el && el.getAttribute('data-throttle-id'))

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

1 participant