【若依】字典中设置按钮样式

效果:

1. 打开 ruoyi-ui.css 文件,设置样式

// 公共的tag样式
.el-tag-common{
	background-color: #ffe5f7;
	border-color: #f3b5de;
	color: #ea6dc1;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	height: 24px;
	padding: 0 9px;
	font-size: 12px;
	line-height: 1;
	border-width: 1px;
	border-style: solid;
	border-radius: 4px;
	box-sizing: border-box;
	white-space: nowrap;
}

// 自定义颜色
 .el-tag-pink {
	 background-color: #ffe5f7;
	 border-color: #f3b5de;
	 color: #ea6dc1;
 }

2. 打开若依项目中的 系统管理 - 字典管理 ,找到对应设置的地方

找到对应的数据字典,进入字典数据,给样式属性上加上对应的class名,记得中间有空格。

新增时填写样式属性为 el-tag-common el-tag-pink

3. 在对应的表格页面去实现字典,会根据值匹配加上el-tag-common el-tag-pink样式生效。

对应页面:

······
<el-table-column label="状态" align="center" prop="status" min-width="80">
   <template #default="scope">
       <dict-tag :options="purchase_order_status" :value="scope.row.status" />
    </template>
</el-table-column>
······

const { purchase_order_status } = proxy.useDict("purchase_order_status");

官方链接:设置字典样式属性没有用 · Issue #I44PWH · 若依/RuoYi - Gitee.com

  • 11
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值