垃圾vite 换成webpack

This commit is contained in:
2023-01-15 17:01:15 +08:00
parent 6ed8c355d8
commit 62c995a321
36 changed files with 7650 additions and 1037 deletions
@@ -0,0 +1,27 @@
<template>
<img :src="svg" :style="style" />
</template>
<script>
const requireAssets = require.context('../assets', false, /\.svg$/)
const SVGs = requireAssets.keys().reduce((svgs, path) => {
const svgFile = requireAssets(path)
svgs[path.match(/^.*\/(.+?)\.svg$/)[1]] = svgFile
return svgs
}, {})
export default {
props: ['type'],
computed: {
svg () {
return SVGs[this.type] || {}
},
style () {
if (this.type === 'next') {
return {
transform: 'rotate(180deg)',
}
}
}
}
}
</script>