Skip to content

Commit e0c038f

Browse files
committed
修复文本位置更新 bug
1 parent 98a8ece commit e0c038f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/editor/inputs/text.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="input-inner vector">
2+
<div class="input-inner text">
33
<div class="fields">
44
<span class="input-title">{{ t("data.main.text") }}</span>
55
<s-text-field
@@ -44,7 +44,7 @@
4444

4545
<script setup lang="ts">
4646
import { PrivateDataTypes } from "@/types/data";
47-
import { ref, toRef } from "vue";
47+
import { ref, toRef, watch } from "vue";
4848
import { useI18n } from "vue-i18n";
4949
import { I18nSchema } from "@/i18n";
5050
const { t } = useI18n<{ message: I18nSchema }>();
@@ -62,11 +62,14 @@ import ColorPicker from "./subblocks/colorPicker.vue";
6262
6363
const locationX = ref<number | "">(self.value.location[0]);
6464
const locationY = ref<number | "">(self.value.location[1]);
65+
66+
watch(locationX, (val) => (self.value.location[0] = val || 0));
67+
watch(locationY, (val) => (self.value.location[1] = val || 0));
6568
</script>
6669

6770
<style lang="scss">
6871
.text-input-box {
6972
width: 100%;
7073
font-size: 18px;
7174
}
72-
</style>
75+
</style>

0 commit comments

Comments
 (0)