layui value column formatting data

Since the data stored in the database is synchronized, gender: 1, 2, status: 1, 2, 3, the page cannot directly display numbers, and the corresponding text needs to be formatted

{
					field : 'XB',
					title : '性别',
					align : 'center',
					width : 80,
					templet : function(d) {
						if (d.XB =='1') {
							return '男'
						} else {
							return '女'
						}
					}
				},

 

Guess you like

Origin blog.csdn.net/Z865785437029/article/details/105681049