You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spring-boot-online-exam/frontend/src/components/tools/Logo.vue

40 lines
1005 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<!-- Logo组件主体 -->
<div class="logo">
<!-- 使用router-link组件创建到dashboard的链接 -->
<router-link :to="{name:'dashboard'}">
<!-- 渲染LogoSvg组件带alt属性说明 -->
<LogoSvg alt="logo" />
<!-- 根据showTitle属性决定是否显示标题 -->
<h1 v-if="showTitle">{{ title }}</h1>
</router-link>
</div>
</template>
<script>// 导入并内联logo.svg作为组件
import LogoSvg from '../../assets/logo.svg?inline'
// 定义并导出一个名为Logo的组件
export default {
name: 'Logo',
// 注册组件内的组件
components: {
LogoSvg
},
props: {
// 设置title属性类型为String默认值为'Online Exam',非必需
title: {
type: String,
default: 'Online Exam',
required: false
},
// 设置showTitle属性类型为Boolean默认值为true非必需
showTitle: {
type: Boolean,
default: true,
required: false
}
}
}
</script>