-
![]()
-
{{slotProps.option.brand}}
+
+
![]()
+
{{slotProps.option.brand}}
@@ -60,4 +60,17 @@ export default {
'SelectButtonDoc': SelectButtonDoc
}
}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/src/views/selectbutton/SelectButtonDoc.vue b/src/views/selectbutton/SelectButtonDoc.vue
index 2f8d2b73f..983be7753 100755
--- a/src/views/selectbutton/SelectButtonDoc.vue
+++ b/src/views/selectbutton/SelectButtonDoc.vue
@@ -40,10 +40,10 @@ export default {
<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>
@@ -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];
}
}
+
+
+
+/deep/ .car-option {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ img {
+ width: 24px;
+ margin-right: .5em;
+ }
+}