ant-design-vue
ant-design-vue copied to clipboard
drawer 组件内部使用vue v-bind-in-css,样式不生效
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Version
4.2.3
Environment
vue4
Reproduction link
Steps to reproduce
1、在drawer外部使用v-bind-in-css, 样式生效
2、在drawer内部使用v-bind-in-css, 样式不生效
What is expected?
使用v-bind-in-css, 样式生效
What is actually happening?
vue没有生成内联样式
可以用body-style的形式
可以用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 节点是脱离的,是因为这个原因导致的吗?
那就这样呗,绑定样式
绑定样式当然可以,但是结构复杂时这么写感觉不太好啊,在内部使用v-bind又不行
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
那就这样呗,绑定样式
在<style scope>中使用v-bind写的样式怎么办?比如我有很多 test-style,用 class 的方式绑定就不行吗?还是说这种用法会有什么局限性?
可以试下绑定class
可以用body-style的形式