mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
添加 cl-view-head 组件
This commit is contained in:
parent
7809870c4f
commit
55ad9b30a6
52
src/modules/base/components/view/head/index.vue
Normal file
52
src/modules/base/components/view/head/index.vue
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<div class="cl-view-head">
|
||||||
|
<el-icon class="cl-view-head__back" @click="router.back()">
|
||||||
|
<ArrowLeft />
|
||||||
|
</el-icon>
|
||||||
|
|
||||||
|
<span class="cl-view-head__title">{{ title }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="cl-view-head">
|
||||||
|
import { computed } from "vue";
|
||||||
|
import { useCool } from "/@/cool";
|
||||||
|
import { ArrowLeft } from "@element-plus/icons-vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: String
|
||||||
|
});
|
||||||
|
|
||||||
|
const { route, router } = useCool();
|
||||||
|
|
||||||
|
// 标题
|
||||||
|
const title = computed(() => props.title || route.query.title);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cl-view-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
height: 30px;
|
||||||
|
|
||||||
|
&__back {
|
||||||
|
cursor: pointer;
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
font-size: 16px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: var(--el-fill-color-lighter);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user