style: 本地化图标
This commit is contained in:
parent
b2cee10cc4
commit
608bf50e1c
|
@ -28,7 +28,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iconify/iconify": "^3.1.1",
|
"@iconify/iconify": "^3.1.1",
|
||||||
"@iconify/vue": "^4.1.1",
|
|
||||||
"@vueuse/core": "^10.7.0",
|
"@vueuse/core": "^10.7.0",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
"@wangeditor/editor-for-vue": "^5.1.10",
|
"@wangeditor/editor-for-vue": "^5.1.10",
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { computed, unref } from 'vue'
|
||||||
import { ElIcon } from 'element-plus'
|
import { ElIcon } from 'element-plus'
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
import { useDesign } from '@/hooks/web/useDesign'
|
import { useDesign } from '@/hooks/web/useDesign'
|
||||||
import { Icon } from '@iconify/vue'
|
|
||||||
|
|
||||||
const { getPrefixCls } = useDesign()
|
const { getPrefixCls } = useDesign()
|
||||||
|
|
||||||
|
@ -40,20 +39,25 @@ const getIconifyStyle = computed(() => {
|
||||||
<use :xlink:href="symbolId" />
|
<use :xlink:href="symbolId" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
<Icon v-else :icon="icon" :style="getIconifyStyle" />
|
<!-- <Icon v-else :icon="icon" :style="getIconifyStyle" /> -->
|
||||||
|
<div :class="`${icon} iconify`" :style="getIconifyStyle"></div>
|
||||||
</ElIcon>
|
</ElIcon>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@prefix-cls: ~'@{namespace}-icon';
|
@prefix-cls: ~'@{namespace}-icon';
|
||||||
|
|
||||||
.@{prefix-cls},
|
.@{prefix-cls} {
|
||||||
.iconify {
|
|
||||||
&:hover {
|
|
||||||
:deep(svg) {
|
:deep(svg) {
|
||||||
// stylelint-disable-next-line
|
&:hover {
|
||||||
color: v-bind(hoverColor) !important;
|
color: v-bind(hovercolor) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.iconify {
|
||||||
|
&:hover {
|
||||||
|
color: v-bind(hovercolor) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { defineConfig, toEscapedSelector as e, presetUno } from 'unocss'
|
import { defineConfig, toEscapedSelector as e, presetUno, presetIcons } from 'unocss'
|
||||||
import transformerVariantGroup from '@unocss/transformer-variant-group'
|
import transformerVariantGroup from '@unocss/transformer-variant-group'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
@ -111,6 +111,16 @@ ${selector}:after {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
presets: [presetUno({ dark: 'class', attributify: false })],
|
presets: [
|
||||||
transformers: [transformerVariantGroup()]
|
presetUno({ dark: 'class', attributify: false }),
|
||||||
|
presetIcons({
|
||||||
|
prefix: ''
|
||||||
|
})
|
||||||
|
],
|
||||||
|
transformers: [transformerVariantGroup()],
|
||||||
|
content: {
|
||||||
|
pipeline: {
|
||||||
|
include: [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html|ts)($|\?)/]
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -126,7 +126,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||||
// 拆包
|
// 拆包
|
||||||
output: {
|
output: {
|
||||||
manualChunks: {
|
manualChunks: {
|
||||||
vue: ['vue', 'vue-router', 'pinia', 'vue-i18n'],
|
'vue-chunks': ['vue', 'vue-router', 'pinia', 'vue-i18n'],
|
||||||
'element-plus': ['element-plus'],
|
'element-plus': ['element-plus'],
|
||||||
'wang-editor': ['@wangeditor/editor', '@wangeditor/editor-for-vue'],
|
'wang-editor': ['@wangeditor/editor', '@wangeditor/editor-for-vue'],
|
||||||
echarts: ['echarts', 'echarts-wordcloud']
|
echarts: ['echarts', 'echarts-wordcloud']
|
||||||
|
|
Loading…
Reference in New Issue