Migrate all Vue components from Options API to <script setup>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 17:10:06 +08:00
parent a619be7881
commit 3b7b6ae859
61 changed files with 10835 additions and 11750 deletions

View File

@@ -7,27 +7,17 @@
</li>
</ul>
</template>
<script>
export default {
name: 'ResultDot',
props:['timeResultData', 'select'],
data() {
return {
data: null,
}
},
watch: {
timeResultData: {
handler(newValue) {
this.data = newValue;
},
immediate: true,
deep: true,
},
},
created() {
this.data = this.select;
this.$emitter.on('reset', data => this.data = data);
},
}
<script setup>
import { ref, watch } from 'vue';
import emitter from '@/utils/emitter';
const props = defineProps(['timeResultData', 'select']);
const data = ref(props.select);
watch(() => props.timeResultData, (newValue) => {
data.value = newValue;
}, { deep: true });
emitter.on('reset', (val) => data.value = val);
</script>