本文介绍了在dijit小部件中保留数据属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经开始在我的应用程序中使用HTML5 数据 -
属性,但是当它应用于一个dijit小部件的元素时,它就会消失。 >
I've started using the HTML5 data-
attributes in my application, but when this is applied to an element that is a dijit widget, it disappears.
<button dojoType="dijit.form.Button" data-id="5">Number 5</button>
dojo是否真的解析这个并保持在某处?或者是完全删除,因为dojo不符合HTML5?
Is dojo actually parsing this and keeping it somewhere? Or is it just removed completely because dojo isn't HTML5 compliant?
推荐答案
通过应用这个,我也可以保留自定义数据 -
周围元素的属性。
By applying the answer to this question, I was also able to keep the custom data-
attributes on the surrounding element.
这篇关于在dijit小部件中保留数据属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!