Skip to content
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

[Bug Report] popup 组件内 在style 里 使用v-bind 不生效 #11605

Closed
xixiaocheng opened this issue Feb 21, 2023 · 1 comment
Closed

[Bug Report] popup 组件内 在style 里 使用v-bind 不生效 #11605

xixiaocheng opened this issue Feb 21, 2023 · 1 comment

Comments

@xixiaocheng
Copy link

xixiaocheng commented Feb 21, 2023

重现链接

https://codesandbox.io/s/vant-3-issue-template-forked-qmkihw

Vant 版本

4.0.10

描述一下你遇到的问题。

https://www.jianshu.com/p/4cd415293fcb

遇到类似的问题,但是我的组件是挂在#app上的

sandbox不支持v-bind在style上所以没有参考性

重现步骤

<template>
    <span class="test" @click="showfun">这里是正常的</span>
  <van-popup v-model:show="show" teleport="#app">
    <div class="test">这里没有颜色</div>
  </van-popup>
</template>

<script setup>
import { ref } from "vue";
const show = ref(false);

const background = ref("blue");

const showfun = () => {
  show.value = true;
};
</script>

<style lang="scss" scoped>
.test {
  background: v-bind(background);
}
</style>

设备/浏览器

No response

@chenjiahan
Copy link
Member

这是一个 Vue 框架的已知问题,使用 Vue 的 Teleport 组件后会导致 v-bind CSS 不可用。

官方已经有 issue 在跟进,可以关注下:vuejs/core#7312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants