-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
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
NScrollbar rendered div element lose scoped css attr data-v-*,渲染出来的 div 丢失 vue 局部样式标记属性。 #5084
Labels
bug
Something isn't working
Comments
本地测试是 这里的 |
function useReizeObserver(target: MaybeRef<HTMLElement | null>, handler: (p: Param) => void) : () => void {
const observer = new ResizeObserver(handler)
const stop = () => {
observer.disconnect()
}
watch(target, (t, o) => {
o && observer.unobserve(o)
t && observer.observe(t)
}, { imediate: true })
beforeUnmount(stop)
return stop
}
// 在 setup 里
useResizeObserver(wrapperRef, handleContainerResize) 这样就不需要包裹无渲染组件,少一层组件实例。还能避免 |
XieZongChen
added
bug
Something isn't working
and removed
untriaged
need to sort
labels
Jul 24, 2023
This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem |
现在这依旧是一个存在的问题,v2.38.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TuSimple/naive-ui version (版本)
2.34.4
Vue version (Vue 版本)
3.3.4
Browser and its version (浏览器及其版本)
Chrome (114.0.5735.201)
System and its version (系统及其版本)
Windows 11
Node version (Node 版本)
Reappearance link (重现链接)
https://codesandbox.io/p/sandbox/gracious-elgamal-p9l754?file=%2Fsrc%2FApp.vue%3A9%2C33
Reappearance steps (重现步骤)
在 VUE SFC 使用
NScrollbar
,并加上 class,<NScrollbar class="my-scrollbar">
SFC 包含
<style scoped>
Expected results (期望的结果)
NScrollbar 渲染出来的
div.n-scrollbar.my-scrollbar
元素 正确 包含 scoped css attr:data-v-*
Actual results (实际的结果)
未包含。 NScrollbar 组件 实例的 $el 为 Text Node, 下一个元素
nextSibling
才是 渲染的div.n-scrollbar.my-scrollbar
此问题 类似于 issue #1788
Remarks (补充说明)
The text was updated successfully, but these errors were encountered: