2020-11-17 15:57:30 +08:00

67 lines
1.3 KiB
Vue

<!-- -->
<template>
<div class="header-title">
<div class="header-title-img">
<img :src="obj.src|| ''" :onerror="defaultImg" alt="">
</div>
<div v-if="isShow" class="header-title-right commonFont">
<span v-if="obj.name" style="font-size:14px;">{{obj.name || "熊成强"}}</span>
<span v-if="obj.departmentName" style="font-size:12px;">{{obj.departmentName || "技术部门"}}</span>
</div>
</div>
</template>
<script>
export default {
props: {
obj: {
type: Object,
default: () => { return {} }
},
isShow: {
type: Boolean,
default: true
}
},
data () {
return {
defaultImg: 'this.src="' + require('@/assets/img/default.jpg') + '"'
}
},
computed: {},
beforeMount () {},
mounted () {},
methods: {},
watch: {}
}
</script>
<style lang='less' scoped>
.header{
width: 100%;
&-title{
// margin: 0 0 10PX 0;
display: flex;
align-items: center;
justify-content: center;
&-img{
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
img{
width: 100%;
height: 100%;
}
}
&-right{
margin-left: 20px;
display: flex;
flex-direction: column;
}
}
}
</style>