1313 <s-scroll-view >
1414 <VueDraggable
1515 v-model =" graphData"
16- :animation =" 300 "
16+ :animation =" 200 "
1717 handle =" .datablock-drag"
18+ :key =" draggerKey"
1819 >
1920 <DataBlock
2021 v-for =" (dataItem, i) in graphData"
7879 :data =" toOriginalDatum(graphData)"
7980 :width =" graphWidth"
8081 :height =" graphHeight"
81- :key =" key "
82+ :key =" graphKey "
8283 @requireFullUpdate =" fullUpdate"
83- @requirePostUpdate =" key ++"
84+ @requirePostUpdate =" graphKey ++"
8485 v-model =" fullUpdateState"
8586 />
8687 </div >
9192
9293<script setup lang="ts">
9394import { useI18n } from " vue-i18n" ;
94- const { t } = useI18n ();
95+ const { t, locale } = useI18n ();
9596
9697import Navbar from " ./components/nav.vue" ;
9798import Graph from " ./components/graph.vue" ;
9899import DataBlock from " ./components/dataBlock.vue" ;
99100import CodeDisplay from " ./components/codeDisplay.vue" ;
100101import { VueDraggable } from " vue-draggable-plus" ;
101102import type { FunctionPlotDatum } from " function-plot" ;
102- import { onMounted , ref } from " vue" ;
103+ import { onMounted , ref , watch } from " vue" ;
103104import JSON5 from " json5" ;
104105import base64 from " base-64" ;
105106import utf8 from " utf8" ;
@@ -113,7 +114,7 @@ const graphData = ref<InternalDatum[]>([
113114const innerDrawer = ref <HTMLElementTagNameMap [" s-drawer" ]>();
114115const graphWidth = ref (0 ),
115116 graphHeight = ref (0 );
116- const key = ref (0 );
117+ const graphKey = ref (0 );
117118const fullUpdateState = ref (false );
118119const sideRatio = ref (33 );
119120const onResize = ref (false );
@@ -131,7 +132,7 @@ onMounted(() => {
131132
132133function fullUpdate() {
133134 fullUpdateState .value = true ;
134- key .value ++ ;
135+ graphKey .value ++ ;
135136}
136137
137138onMounted (() => {
@@ -186,6 +187,9 @@ function handleImport() {
186187 importStr .value = " " ;
187188 }
188189}
190+
191+ const draggerKey = ref (0 );
192+ watch (locale , () => draggerKey .value ++ );
189193 </script >
190194
191195<style >
0 commit comments