问题描述
我正在使用此转换在常规表'td'内构建jQuery移动按钮:
I'm using this transform to build a jQuery mobile button inside of a regular table 'td':
{
"tag":"button",
"type":"button",
"id":"${idPrefix}-delete",
"data-role":"button",
"data-mini":"true",
"data-icon":"delete",
"html":"Delete"
}
但它呈现为旧的HTML按钮.
but it renders as an old HTML button.
手动刷新按钮后,它看起来像是带有图标的移动按钮,但其中的旧按钮已缩小".
After I manually refresh the button, it looks like a mobile button with the icon, but the old button is "minified" inside of it.
如何解决?
缺少::before
?
missing ::before
?
我只是将它与外观正常的移动按钮进行了比较,有问题的按钮恰好在<button>
标签之前缺少了::before
.
I just compared it to a normal looking mobile button, and the problematic button is missing the ::before
right before the <button>
tag.
我删除了所有移动属性,并尝试稍后调用button()
,结果相同.
I removed all of the mobile attributes and tried to call button()
later, same result.
推荐答案
为了加快webapp的初始化速度并提高jQM的性能,jQM团队决定删除.buttonMarkup()
小部件并用类替换.
To speed-up webapp initializing and to increase jQM's performance, jQM team decided to drop .buttonMarkup()
widget and replace it with classes.
不再有data-role=button
,data-mini=true
等...全部替换为以下类.
There is no longer data-role=button
, data-mini=true
, etc... All are replaced with classes as follows.
要将按钮或锚点转换为jQM按钮,只需添加ui-btn
类.添加位置为ui-btn-icon-left
,right
,top
,bottom
的图标.图标的图像ui-icon-bars
,delete
,info
等.迷你按钮/锚点ui-mini
. Button的主题ui-btn-a
或b
.
To convert a button or an anchor into a jQM button, just add ui-btn
class. To add an icon with position ui-btn-icon-left
, right
, top
, bottom
. Icon's image ui-icon-bars
, delete
, info
, etc. Mini button/anchor ui-mini
. Button's theme ui-btn-a
or b
.
<button class="ui-btn ui-mini ui-btn-icon-right ui-icon-delete">Button</button>
这篇关于表td中的json2htmled jQuery移动按钮看起来很旧,在button()/refresh之后在新按钮中有一个旧按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!