feat: 新增TitleComponent组件

This commit is contained in:
jackhoo_98 2023-01-10 13:44:31 +08:00
parent bd267b32ff
commit c2b83da156
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,41 @@
<template>
<div class="title">
<div class="title-before"></div>
<span>{{ data }}</span>
<slot name="extra"></slot>
</div>
</template>
<script>
export default {
name: "TitleComponent",
props: {
data: {
type: String,
default: ""
}
},
};
</script>
<style lang="less" scoped>
.title {
position: relative;
width: 100%;
margin-bottom: 10px;
padding-left: 10px;
color: rgba(0, 0, 0, 0.8);
font-weight: 600;
font-size: 16px;
}
.title-before {
position: absolute;
top: 0;
left: 0;
width: 4px;
height: calc(100% - 2px);
background-color: @primary-color;
border-radius: 0 3px 3px 0;
}
</style>

View File

@ -1,10 +1,12 @@
import type { App } from 'vue'
import AIcon from './AIcon'
import PermissionButton from './PermissionButton/index.vue'
import TitleComponent from "./TitleComponent/index.vue";
export default {
install(app: App) {
app.component('AIcon', AIcon)
app.component('PermissionButton', PermissionButton)
app.component('TitleComponent', TitleComponent)
}
}