SelectButton demo update
parent
7016969524
commit
ebf550f535
|
@ -19,9 +19,9 @@
|
|||
<h3>Custom Content</h3>
|
||||
<SelectButton v-model="selectedCar" :options="cars" optionLabel="brand">
|
||||
<template #option="slotProps">
|
||||
<div style="text-align: center; padding: 1em; width: 125px">
|
||||
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" style="width:48px" />
|
||||
<div style="margin-top: 1em">{{slotProps.option.brand}}</div>
|
||||
<div class="car-option">
|
||||
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" />
|
||||
<div>{{slotProps.option.brand}}</div>
|
||||
</div>
|
||||
</template>
|
||||
</SelectButton>
|
||||
|
@ -61,3 +61,16 @@ export default {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .car-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
margin-right: .5em;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -40,10 +40,10 @@ export default {
|
|||
<template v-pre>
|
||||
<SelectButton v-model="selectedCar" :options="cars" optionLabel="brand">
|
||||
<template #option="slotProps">
|
||||
<div style="text-align: center; padding: 1em; width: 125px">
|
||||
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" style="width:48px" />
|
||||
<div style="margin-top: 1em">{{slotProps.option.brand}}</div>
|
||||
</div>
|
||||
<div class="car-option">
|
||||
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" />
|
||||
<div>{{slotProps.option.brand}}</div>
|
||||
</div>
|
||||
</template>
|
||||
</SelectButton>
|
||||
</template>
|
||||
|
@ -171,9 +171,9 @@ export default {
|
|||
<h3>Custom Content</h3>
|
||||
<SelectButton v-model="selectedCar" :options="cars" optionLabel="brand">
|
||||
<template #option="slotProps">
|
||||
<div style="text-align: center; padding: 1em; width: 125px">
|
||||
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" style="width:48px" />
|
||||
<div style="margin-top: 1em">{{slotProps.option.brand}}</div>
|
||||
<div class="car-option">
|
||||
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" />
|
||||
<div>{{slotProps.option.brand}}</div>
|
||||
</div>
|
||||
</template>
|
||||
</SelectButton>
|
||||
|
@ -204,6 +204,19 @@ export default {
|
|||
this.selectedCar = this.cars[1];
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
/deep/ .car-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
margin-right: .5em;
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
|
|
Loading…
Reference in New Issue