feat:【ele】【mall】diy-editor 的 tab-bar 使用 tailwindcss 简化 style
This commit is contained in:
@@ -11,9 +11,9 @@ defineOptions({ name: 'TabBar' });
|
|||||||
defineProps<{ property: TabBarProperty }>();
|
defineProps<{ property: TabBarProperty }>();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="tab-bar">
|
<div class="z-[2] w-full">
|
||||||
<div
|
<div
|
||||||
class="tab-bar-bg"
|
class="flex flex-row items-center justify-around py-2"
|
||||||
:style="{
|
:style="{
|
||||||
background:
|
background:
|
||||||
property.style.bgType === 'color'
|
property.style.bgType === 'color'
|
||||||
@@ -26,7 +26,7 @@ defineProps<{ property: TabBarProperty }>();
|
|||||||
<div
|
<div
|
||||||
v-for="(item, index) in property.items"
|
v-for="(item, index) in property.items"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="tab-bar-item"
|
class="tab-bar-item flex w-full flex-col items-center justify-center text-xs"
|
||||||
>
|
>
|
||||||
<ElImage :src="index === 0 ? item.activeIconUrl : item.iconUrl">
|
<ElImage :src="index === 0 ? item.activeIconUrl : item.iconUrl">
|
||||||
<template #error>
|
<template #error>
|
||||||
@@ -48,25 +48,7 @@ defineProps<{ property: TabBarProperty }>();
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.tab-bar {
|
|
||||||
z-index: 2;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.tab-bar-bg {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 8px 0;
|
|
||||||
|
|
||||||
.tab-bar-item {
|
.tab-bar-item {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 12px;
|
|
||||||
|
|
||||||
:deep(img),
|
:deep(img),
|
||||||
.el-icon {
|
.el-icon {
|
||||||
width: 26px;
|
width: 26px;
|
||||||
@@ -74,6 +56,4 @@ defineProps<{ property: TabBarProperty }>();
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user