类星体文件选择器组件,以在<q-file>中更改选定文件名的文本颜色。

所选择的文本文件为test.odt,如何更改它的文本颜色,例如Red
<q-file
standout
class="registration-field text-red"
bg-color="blue-2"
v-model="registrationNumber"
color="red"
>
<template v-slot:prepend>
<q-icon name="o_insert_photo" size="24px" color="blue" />
</template>
<template v-slot:append>
<div class="attachment text-grey-14">File</div>
</template>
</q-file>我试过使用风格道具color="red",但它不起作用。
有人知道怎么做吗?
发布于 2020-10-21 10:05:35
您可以使用file插槽并添加text-red类,它可以工作。
<q-file
standout
class="registration-field text-red"
bg-color="blue-2"
v-model="registrationNumber"
color="red"
>
<template v-slot:prepend>
<q-icon name="photo" size="24px" color="blue"/>
</template>
<template v-slot:append>
<div class="attachment text-grey-14">File</div>
</template>
<template v-slot:file="{ index, file }">
<div class="ellipsis text-red relative-position">
{{ file.name }}
</div>
<q-tooltip>
{{ file.name }}
</q-tooltip>
</template>
</q-file>https://stackoverflow.com/questions/64224621
复制相似问题