给FastAdmin项目中的切换开关按钮添加文字提示:
要修改的文件路径:public/assets/js/require-table.js 的第430行
toggle: function (value, row, index) {
var color = typeof this.color !== 'undefined' ? this.color : 'success';
var yes = typeof this.yes !== 'undefined' ? this.yes : 1;
var no = typeof this.no !== 'undefined' ? this.no : 0;
return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change' data-id='"
+ row.id + "' data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on " + (value == yes ? 'text-' + color : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>" + (value == yes ? '是' : '否');
},
介绍了给FastAdmin项目中的切换开关按钮添加文字提示的方法,需修改public/assets/js/require-table.js文件的第430行代码,通过特定代码实现点击切换及显示“是”“否”文字提示。
1741

被折叠的 条评论
为什么被折叠?



