【发布时间】:2021-09-29 09:02:45
【问题描述】:
我刚刚创建了一个空白的 Nativescript Vue 项目 (Typescript) 并尝试将字符串绑定到 Label 的 type 属性 - 不起作用(样式被完全忽略)。我也试过 Nativescript Playground,结果一样。
示例代码是:
<template>
<Page>
<ActionBar title="Example" />
<StackLayout>
<Label style="font-size: 34" text="WORKS" />
<Label :style="myStyle" text="DOES NOT WORK" />
</StackLayout>
</Page>
</template>
<script>
export default {
data() {
return {
myStyle: "font-size: 34"
};
}
};
</script>
<style scoped>
</style>
您可以在 Nativescript Vue Playground 中重现。在我的 Mac 上,我使用 Nativescript 8.1.2 和 nativescript-vue 2.9.0。
我希望应该可以做这样的事情。任何帮助表示赞赏,谢谢。
【问题讨论】:
标签: vue.js styles nativescript bind