N
N
Nik2017-04-20 05:46:47
Vue.js
Nik, 2017-04-20 05:46:47

How to change the name of data-attribute?

Greetings! using skrollr, it uses data-attr like ( data-0='',data-100=''...). the question is how do I change the data of the name of the data attribute itself (i.e. item.scroll100 = (100) comes to props and must be substituted into the data-(item.scroll100)='' attribute). how can this be set up?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2017-04-20
@KoiLVeD

As an option, use the render function and dynamically create an attribute.
I made an example, I think you can adapt it for yourself: codepen.io/kerf/pen/OmMqqP
In the example, the data-## attribute is dynamically created based on the scroll prop of the component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question