z***@163.com
z***@163.com
  • 发布:2020-05-21 09:26
  • 更新:2021-11-08 10:38
  • 阅读:837

UNIAPP请问如何给v-html渲染后的某一标签添加事件

分类:uni-app

例如:

<template>  
	<view>  
		<view v-html="content"></view>  
	</view>  
</template>  
  
<script>  
	export default {  
		data() {  
			return {  
				content: `<p>DSDSD大<span style="background-color: rgb(121, 214, 201);">事发生大发发送到发打</span>发第三方大师傅大事发生大发<span style="color: rgb(224, 81, 81);">是打发第三方asdfas</span>dfasd<strong  
					 style="font-size: 24px;">fasdf法</strong>师打发第三方</p>  
				<p>DSDSD大<span style="background-color: rgb(121, 214, 201);">事发生大发发送到发打</span>发第三方大师傅大事发生大发<span style="color: rgb(224, 81, 81);">是打发第三方asdfas</span>dfasd<strong  
					 style="font-size: 24px;">fasdf法</strong>师打发第三方</p>  
				<p><img src="https://www.baidu.com/img/flexible/logo/pc/result.png" alt="图像"></p>`  
			};  
		},  
		methods: {  
			  
		}  
	}  
</script>  
  
<style lang="scss">  
  
</style>

我想在 content 渲染后的 img 标签上绑定事件,请问该如何实现?

2020-05-21 09:26 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com

请问解决了么,我也遇到同样的问题了

LRL啊

LRL啊

有解决吗?

陈大雷Q

陈大雷Q

https://www.jb51.net/article/172945.htm试一下这个

  • LRL啊

    这个我试过了,在uniapp里面只有点击位置坐标,没有点击子元素的信息


    2021-11-08 10:41

该问题目前已经被锁定, 无法添加新回复