添加帮助图标
This commit is contained in:
@@ -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>
|
||||
@@ -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)
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
// import './axios'
|
||||
import dialog from './Dialog'
|
||||
import './Tips'
|
||||
import svgIcon from './SvgIcon'
|
||||
|
||||
export default app => {
|
||||
app.use(dialog)
|
||||
|
||||
svgIcon(app)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user