vueComponent / ant-design-vue

🌈 An enterprise-class UI components based on Ant Design and Vue. 🐜
https://antdv.com/
Other
20.08k stars 3.78k forks source link

drawer 组件内部使用vue v-bind-in-css,样式不生效 #7761

Open nailuox opened 1 month ago

nailuox commented 1 month ago

Version

4.2.3

Environment

vue4

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1、在drawer外部使用v-bind-in-css, 样式生效 image

2、在drawer内部使用v-bind-in-css, 样式不生效 image

What is expected?

使用v-bind-in-css, 样式生效

What is actually happening?

vue没有生成内联样式

selicens commented 1 month ago

image 可以用body-style的形式

nailuox commented 1 month ago

image 可以用body-style的形式

https://codesandbox.io/p/sandbox/ji-ben-yong-fa-ant-design-vue-4-2-3-forked-s66yfy?file=%2Fsrc%2Fdemo.vue%3A34%2C3 加了截图中的代码,实际效果不太一样: 1、ant-drawer-body 内部元素test-style依然没有生成内联样式 2、官网文档中写到 drawer message等组件是 Vue.render 重新渲染一个 Vue 根节点上,和主应用的 Vue 节点是脱离的,是因为这个原因导致的吗? image

selicens commented 1 month ago

image 那就这样呗,绑定样式

nailuox commented 1 month ago

绑定样式当然可以,但是结构复杂时这么写感觉不太好啊,在内部使用v-bind又不行