We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本:mp-html 2.3.2 微信小程序基础库版本:2.25.3
mp-html 2.3.2
2.25.3
使用 Search 插件提供的高亮功能,开启锚点功能后,能正常高亮匹配到的关键词,且可以滚动到锚点,但是高亮的元素会独占一行(形同 display: block;),尝试在高亮样式上加入 display: inline; ,无效。尝试修改源码,把 span 的 node type 改成 text,高亮元素直接不显示
display: block;
display: inline;
span
text
<template> <mp-html ref="parser" selectable :use-anchor="true" :tagStyle="tagStyle" :content="content" @load="domLoaded"> </template>
export default { methods: { domLoaded() { const { keyword } = this const useAnchor = true const style = 'display:inline; background-color: yellow; color: #333; font-weight: bold;' if (keyword) { this.$refs.parser.search(keyword, useAnchor, style).then(res => { res.jump(1, 50) }) } } } }
关键词为”管理“
不使用 anchor 功能时,排版正常。
The text was updated successfully, but these errors were encountered:
vue3?
Sorry, something went wrong.
uniapp vue3 模式
修复了 uni-app 包 vue3 使用 search 扩展可能导致错误换行的问题 #449
c84663f
No branches or pull requests
使用环境
版本:
mp-html 2.3.2
微信小程序基础库版本:
2.25.3
问题描述
使用 Search 插件提供的高亮功能,开启锚点功能后,能正常高亮匹配到的关键词,且可以滚动到锚点,但是高亮的元素会独占一行(形同
display: block;
),尝试在高亮样式上加入display: inline;
,无效。尝试修改源码,把span
的 node type 改成text
,高亮元素直接不显示复现方式
关键词为”管理“
![image](https://user-images.githubusercontent.com/32815833/184873475-322837e2-d8f0-4945-a2ba-37a0879e4d5a.png)
不使用 anchor 功能时,排版正常。
![image](https://user-images.githubusercontent.com/32815833/184874576-2c8c2375-409c-4c0d-ae96-5936bd038de0.png)
The text was updated successfully, but these errors were encountered: