-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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] Style variables not working with TSX #3808
Comments
@yyx990803 I've tried Repro: https://github.com/wenfangdu/vue-3-style-vars-tsx-repro |
Can anyone reopen this 🙏? |
I will check it later |
@wenfangdu Can't reproduce, maybe you need to reinstall the deps to make sure you really update the deps |
@HcySunYang I've tried deleting node_modules and package.json and updated vue to I've updated repro to reflect this: <!-- 👇 works -->
<script lang="ts">
import { defineComponent, h } from 'vue'
export default defineComponent({
data() {
return {
color: 'red',
font: {
size: '2em',
},
}
},
setup() {
return () => h('div', { class: 'text' }, 'hello')
},
})
</script>
<!-- 👇 works -->
<script>
import { defineComponent } from 'vue'
export default defineComponent({
data() {
return {
color: 'red',
font: {
size: '2em',
},
}
},
setup() {
return () => <div class='text'>hello</div>
},
})
</script>
<!-- 👇 does not work -->
<script lang="tsx">
import { defineComponent } from 'vue'
export default defineComponent({
data() {
return {
color: 'red',
font: {
size: '2em',
},
}
},
setup() {
return () => <div class='text'>hello</div>
},
})
</script>
<style>
body {
background: #000;
text-align: center;
}
.text {
color: v-bind(color);
/* expressions (wrap in quotes) */
font-size: v-bind('font.size');
}
</style> Just a black screen: If it works, it should show: |
@wenfangdu |
@edison1105 Thanks for the tip! |
Version
3.1.0-beta.3
Reproduction link
https://github.com/wenfangdu/vue-3-style-vars-tsx-repro
Steps to reproduce
Please see
App.vue
.What is expected?
Works with TSX
What is actually happening?
Not working with TSX
The text was updated successfully, but these errors were encountered: