Pārlūkot izejas kodu

chore: 升级`vue^3.4.0`,整体性能得到不错的提升

xiaoxian521 1 gadu atpakaļ
vecāks
revīzija
50a4b177d4

+ 1 - 1
package.json

@@ -88,7 +88,7 @@
     "v-contextmenu": "3.0.0",
     "v3-infinite-loading": "^1.3.1",
     "version-rocket": "^1.7.1",
-    "vue": "^3.3.13",
+    "vue": "^3.4.0",
     "vue-i18n": "^9.8.0",
     "vue-json-pretty": "^2.3.0",
     "vue-pdf-embed": "^1.2.1",

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 179 - 189
pnpm-lock.yaml


+ 3 - 10
src/components/ReAnimateSelector/src/index.vue

@@ -7,15 +7,8 @@ defineOptions({
   name: "ReAnimateSelector"
 });
 
-const props = defineProps({
-  modelValue: {
-    require: false,
-    type: String
-  }
-});
-const emit = defineEmits<{ (e: "update:modelValue", v: string) }>();
+const inputValue = defineModel({ type: String });
 
-const inputValue = toRef(props, "modelValue");
 const animatesList = ref(animates);
 const copyAnimatesList = cloneDeep(animatesList);
 
@@ -47,11 +40,11 @@ const animateStyle = computed(
 );
 
 function onChangeIcon(animate: string) {
-  emit("update:modelValue", animate);
+  inputValue.value = animate;
 }
 
 function onClear() {
-  emit("update:modelValue", "");
+  inputValue.value = "";
 }
 
 function filterMethod(value: any) {

+ 7 - 14
src/components/ReIcon/src/Select.vue

@@ -10,15 +10,8 @@ defineOptions({
   name: "IconSelect"
 });
 
-const props = defineProps({
-  modelValue: {
-    require: false,
-    type: String
-  }
-});
-const emit = defineEmits<{ (e: "update:modelValue", v: string) }>();
+const inputValue = defineModel({ type: String });
 
-const inputValue = toRef(props, "modelValue");
 const iconList = ref(IconJson);
 const icon = ref();
 const currentActiveType = ref("ep:");
@@ -68,11 +61,11 @@ const iconItemStyle = computed((): ParameterCSSProperties => {
 });
 
 function setVal() {
-  currentActiveType.value = props.modelValue.substring(
+  currentActiveType.value = inputValue.value.substring(
     0,
-    props.modelValue.indexOf(":") + 1
+    inputValue.value.indexOf(":") + 1
   );
-  icon.value = props.modelValue.substring(props.modelValue.indexOf(":") + 1);
+  icon.value = inputValue.value.substring(inputValue.value.indexOf(":") + 1);
 }
 
 function onBeforeEnter() {
@@ -96,7 +89,7 @@ function handleClick({ props }) {
 
 function onChangeIcon(item) {
   icon.value = item;
-  emit("update:modelValue", currentActiveType.value + item);
+  inputValue.value = currentActiveType.value + item;
 }
 
 function onCurrentChange(page) {
@@ -105,7 +98,7 @@ function onCurrentChange(page) {
 
 function onClear() {
   icon.value = "";
-  emit("update:modelValue", "");
+  inputValue.value = "";
 }
 
 watch(
@@ -117,7 +110,7 @@ watch(
   { immediate: true }
 );
 watch(
-  () => props.modelValue,
+  () => inputValue.value,
   val => val && setVal(),
   { immediate: true }
 );

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels