javascript - How vue dynamically adds instructions to tags (using js to add instructions to tags)
淡淡烟草味
淡淡烟草味 2017-05-19 10:25:15
0
2
613

Now that there is an html tag, you need to use js to add instructions to the tag.
It’s like: html: <img />
Then use js to make the html become <img v-lazy='fn'/>

淡淡烟草味
淡淡烟草味

reply all(2)
给我你的怀抱

This method is not recommended in vue. The recommendation is to use state-driven views.

You can choose v-if tag to achieve this effect.

<img v-if='imgLazyFlag' v-lazy='fn' />
<img v-else />
PHPzhong

Refer to the official documentation:
Custom instructions

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!