添加帮助图标

This commit is contained in:
lyswhut
2021-12-31 11:48:11 +08:00
parent f8d06d38ab
commit 1c946ac661
15 changed files with 997 additions and 19 deletions
+33
View File
@@ -0,0 +1,33 @@
<template>
<svg class="svg-icon" aria-hidden="true">
<use :xlink:href="id" />
</svg>
</template>
<script>
export default {
name: 'SvgIcon',
props: {
name: {
type: String,
required: true,
},
},
computed: {
id() {
return `#icon-${this.name}`
},
},
}
</script>
<style>
.svg-icon {
width: 1.2em;
height: 1.2em;
vertical-align: -0.25em;
fill: currentColor;
overflow: hidden;
}
</style>
+9
View File
@@ -0,0 +1,9 @@
import SvgIcon from './SvgIcon'
const req = require.context('@renderer/assets/svgs', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)
export default app => {
app.component('svg-icon', SvgIcon)
}
+3
View File
@@ -1,7 +1,10 @@
// import './axios'
import dialog from './Dialog'
import './Tips'
import svgIcon from './SvgIcon'
export default app => {
app.use(dialog)
svgIcon(app)
}