【发布时间】:2021-05-18 01:16:56
【问题描述】:
我有一个 Vuetify 滑块,在前置槽中有一个减号图标,在附加槽中有一个加号图标。
如果我在附加槽中再添加一个文本字段,则加号图标和文本字段不会与滑块对齐。如何使它们对齐?
<v-app id="app">
<v-card>
<v-card-title>Vuetify Slider append slot is not aligned if more than one element</v-card-title>
<v-subheader>Append slot contains only one plus icon, the plus icon is aligned with the slider</v-subheader>
<v-card-text>
<v-slider v-model="bpm" track-color="grey" always-dirty thumb-label="always" min="1" max="422">
<template v-slot:prepend>
<v-icon :color="color" @click="bpm--">
mdi-minus
</v-icon>
</template>
<template v-slot:append>
<v-icon :color="color" @click="bpm++">
mdi-plus
</v-icon>
</template>
</v-slider>
</v-card-text>
<v-subheader>Append slot contains one icon and one text field, the plus icon and text field are not aligned with the slider</v-subheader>
<v-card-text>
<v-slider v-model="bpm" track-color="grey" always-dirty thumb-label="always" min="1" max="422">
<template v-slot:prepend>
<v-icon :color="color" @click="bpm--">
mdi-minus
</v-icon>
</template>
<template v-slot:append>
<v-icon :color="color" @click="bpm++">
mdi-plus
</v-icon>
<!-- The only difference is this text field-->
<v-text-field v-model="bpm"></v-text-field>
</template>
</v-slider>
</v-card-text>
</v-card>
</v-app>
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: () => ({
bpm: 10
}),
})
【问题讨论】:
标签: vuetify.js