vue 传入html元素 v-html

本文探讨了模块化UI设计的概念,如何通过不同颜色和图标组合来表达信息,以及在前端开发中实现这一设计的方法。文章详细介绍了使用Vue.js进行模块化设计的实践,包括动态绑定样式和内容,以及如何通过v-if和v-else指令处理不同的显示情况。
<ul class="layui-row layui-col-space10">
	<li class="layui-col-xs6" v-for="module in item.modules">
		<a href="javascript:;" class="layadmin-backlog-body">
			<h3 v-bind:style="{color:module.color}">
				<span v-html="module.icon"></span>
					<template v-if="module.children.length > 1">
						{{module.children[0].name}} / {{module.children[1].name}}
					</template>
					<template v-else="">
						{{module.children[0].name}} 
					</template>
			</h3>
			<p align="center">
				<cite v-bind:style="{color:module.color}">
						<template v-if="module.children.length == 2">
							{{module.children[0].value}} / {{module.children[1].value}}
						</template>
						<template v-else="module.children.length == 1">
							{{module.children[0].value}} 
						</template>
				</cite>
			</p>
		</a>
	</li>
</ul>

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值