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.
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 >