ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

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

Open nailuox opened this issue 1 year ago • 4 comments
trafficstars

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

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没有生成内联样式

nailuox avatar Jul 30 '24 09:07 nailuox

image 可以用body-style的形式

selicens avatar Jul 31 '24 09:07 selicens

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

nailuox avatar Aug 01 '24 02:08 nailuox

image 那就这样呗,绑定样式

selicens avatar Aug 01 '24 02:08 selicens

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

nailuox avatar Aug 01 '24 03:08 nailuox

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

github-actions[bot] avatar Oct 01 '24 02:10 github-actions[bot]

image 那就这样呗,绑定样式

<style scope>中使用v-bind写的样式怎么办?比如我有很多 test-style,用 class 的方式绑定就不行吗?还是说这种用法会有什么局限性?

Yee1014 avatar May 22 '25 06:05 Yee1014

可以试下绑定class

selicens avatar May 22 '25 06:05 selicens