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

prop 传参时,待符号无法正常在 class 中渲染吗? #30

Closed
4 tasks done
carveybunt opened this issue Nov 18, 2023 · 2 comments
Closed
4 tasks done

prop 传参时,待符号无法正常在 class 中渲染吗? #30

carveybunt opened this issue Nov 18, 2023 · 2 comments

Comments

@carveybunt
Copy link

描述问题

<template>
<view :class="z">
</template>
</template>

<script setup lang="ts">
interface Props {
  z: string,
}

const props = withDefaults(
  defineProps<Props>(),
  {
    z: 'z-[123]',
  },
)
</script>

无法正常在 class 中渲染。 z 正常渲染结果为:'z--123-',而实际得到的结果是:'z 123'。

复现

<template>
<view :class="z">
</template>
</template>

<script setup lang="ts">
interface Props {
  z: string,
}

const props = withDefaults(
  defineProps<Props>(),
  {
    z: 'z-[123]',
  },
)
</script>

系统信息

vscode:1.84.2
node:18.18.0
npm:9.8.1
vue:3.3.4
vite:4.1.4
vite-plugin-uni-tailwind: 0.13.1
tailwindcss:3.3.3

使用的包管理器

npm

核对

  • 遵循我们的 行为准则
  • 检查是否已经有一个报告相同错误的问题,以避免重复创建。
  • 这是一个具体的错误。请开启 GitHub 讨论你的疑问。
  • 所提供的复现是这个问题的 最小复现
@carveybunt carveybunt changed the title prop 传参无法正常在 class 中渲染吗? prop 传参时,待符号无法正常在 class 中渲染吗? Nov 18, 2023
@ModyQyW
Copy link
Member

ModyQyW commented Nov 18, 2023

该问题与 #25 一致。目前 0.14.0-0 支持 string,后续会继续更新增加支持,欢迎尝试反馈,谢谢你的关注!

weapp-tailwindcss 之前有遇到过类似的问题,见 sonofmagic/weapp-tailwindcss#140 ,但我个人没有尝试过 weapp-tailwindcss,不确定它是否已克服。

如果不限于 tailwindcss,可以尝试 unocss,配合 @uni-helper/unocss-preset-uni 或 unocss-applet。

@ModyQyW
Copy link
Member

ModyQyW commented Nov 27, 2023

请跟踪 #25

@ModyQyW ModyQyW closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants