图表加载提交

menu_style
zhangdi 3 months ago
parent 9d0972cf79
commit e191d25b68
  1. 85
      src/components/svg-icon/svg.vue
  2. 1
      src/page/index/top/index.vue
  3. 5
      src/page/index/top/top-login.vue

@ -1,54 +1,53 @@
<template>
<!-- svg 渲染本地SVG的静态资源 -->
<svg :width="size" :height="size" :class="` ${className}` ">
<use :xlink:href="`#icon-${name}`" ></use>
</svg>
<svg :class="svgClass" aria-hidden="true">
<use :xlink:href="iconName"></use>
<title v-if="!!title">{{ title }}</title>
</svg>
</template>
<script>
export default{
props:{
// SVG
name:{
type:String,
required:true,
export default {
name: 'SvgIcon',
props: {
iconClass: {
type: String,
required: true
},
//
className:{
type:String,
default:"",
className: {
type: String
},
// SVG
size:{
type:Number,
default:50,
title: {
type: String,
default: ''
}
},
data(){
return{
mounted(){
console.log(8888,this.iconClass)
},
computed: {
iconName() {
debugger
return `#icon-${this.iconClass}`
},
svgClass() {
if (this.className) {
return 'svg-icon ' + this.className
} else {
return 'svg-icon'
}
}
}
}
// import { computed } from "vue";
// const props=defineProps({
// // SVG
// name:{
// type:String,
// required:true,
// },
// //
// className:{
// type:String,
// default:"",
// },
// // SVG
// size:{
// type:Number,
// default:50,
// }
// })
</script>
<style scoped lang="less">
</style>
<style lang="scss" scoped>
.svg-icon {
width: 1.1em;
height: 1.1em;
margin-left: 0.35em;
margin-right: 0.35em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>

@ -133,6 +133,7 @@ import topColor from './top-color.vue';
import topLang from './top-lang.vue';
import topFull from './top-full.vue';
import topSetting from '../setting.vue';
// import topLogin from '../top-login.vue'
import { getUserInfo as getUerDetailInfo } from '@/api/system/user';
import { getUserInfo as getUerOauthInfo } from '@/api/user';
import { validatenull } from '@/utils/validate';

@ -1,15 +1,16 @@
<template>
<div class="top_login">
<!-- 111 -->
<svgs :iconClass="'system-management'"></svgs>
</div>
</template>
<script>
import svg from '@/components/svg-icon/svg.vue';
import svgs from '@/components/svg-icon/svg.vue';
export default {
name: 'top-login',
components:{
svg
svgs
}
}
</script>

Loading…
Cancel
Save