zuohuaijun 1 рік тому
батько
коміт
04f421c591
2 змінених файлів з 6 додано та 23 видалено
  1. 1 1
      Web/package.json
  2. 5 22
      Web/src/components/iconSelector/index.vue

+ 1 - 1
Web/package.json

@@ -79,7 +79,7 @@
 		"terser": "^5.30.4",
 		"typescript": "^5.4.5",
 		"vite": "^5.2.10",
-		"vite-plugin-cdn-import": "^1.0.0",
+		"vite-plugin-cdn-import": "^1.0.1",
 		"vite-plugin-compression2": "^1.1.0",
 		"vite-plugin-vue-setup-extend-plus": "^0.1.0",
 		"vue-eslint-parser": "^9.4.2"

+ 5 - 22
Web/src/components/iconSelector/index.vue

@@ -1,14 +1,6 @@
 <template>
 	<div class="icon-selector w100 h100">
-		<el-input
-			v-model="state.fontIconSearch"
-			:placeholder="state.fontIconPlaceholder"
-			:clearable="clearable"
-			:disabled="disabled"
-			:size="size"
-			ref="inputWidthRef"
-			@clear="onClearFontIcon"
-		>
+		<el-input v-model="state.fontIconSearch" :placeholder="state.fontIconPlaceholder" :clearable="clearable" :disabled="disabled" :size="size" ref="inputWidthRef" @clear="onClearFontIcon">
 			<template #prepend>
 				<SvgIcon
 					:name="state.fontIconPrefix === '' ? prepend : state.fontIconPrefix"
@@ -18,15 +10,7 @@
 				<i v-else :class="state.fontIconPrefix === '' ? prepend : state.fontIconPrefix" class="font14"></i>
 			</template>
 		</el-input>
-		<el-popover
-			placement="bottom"
-			:width="state.fontIconWidth"
-			transition="el-zoom-in-top"
-			popper-class="icon-selector-popper"
-			trigger="click"
-			:virtual-ref="inputWidthRef"
-			virtual-triggering
-		>
+		<el-popover placement="bottom" :width="state.fontIconWidth" transition="el-zoom-in-top" popper-class="icon-selector-popper" trigger="click" :virtual-ref="inputWidthRef" virtual-triggering>
 			<template #default>
 				<div class="icon-selector-warp">
 					<div class="icon-selector-warp-title">{{ title }}</div>
@@ -117,7 +101,6 @@ const state = reactive({
 	},
 });
 
-
 // 图标搜索及图标数据显示
 const fontIconSheetsFilterList = computed(() => {
 	const list = fontIconTabNameList();
@@ -144,7 +127,7 @@ const initModeValueEcho = () => {
 // 处理 icon 类型,用于回显时,tab 高亮与初始化数据
 const initFontIconName = () => {
 	let name = 'ali';
-    if(props.modelValue == undefined) name = 'ele';
+	if (props.modelValue == undefined) name = 'ele';
 	else if (props.modelValue!.indexOf('iconfont') > -1) name = 'ali';
 	else if (props.modelValue!.indexOf('ele-') > -1) name = 'ele';
 	else if (props.modelValue!.indexOf('fa') > -1) name = 'awe';
@@ -220,10 +203,10 @@ onMounted(() => {
 watch(
 	() => props.modelValue,
 	() => {
-        state.fontIconSearch='';
+		state.fontIconSearch = '';
 		initModeValueEcho();
 		initFontIconName();
-        getInputWidth();
+		getInputWidth();
 	}
 );
 </script>