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

@@ -8,26 +8,21 @@
</li>
</ul>
</template>
<script>
export default {
name: 'ResultCheck',
props:['data', 'select'],
data() {
return {
datadata: null,
}
},
watch: {
data: function(newValue) {
this.datadata = newValue;
},
select: function(newValue) {
this.datadata = newValue;
}
},
created() {
this.datadata = this.select;
this.$emitter.on('reset', data => this.datadata = data);
},
}
<script setup>
import { ref, watch } from 'vue';
import emitter from '@/utils/emitter';
const props = defineProps(['data', 'select']);
const datadata = ref(props.select);
watch(() => props.data, (newValue) => {
datadata.value = newValue;
});
watch(() => props.select, (newValue) => {
datadata.value = newValue;
});
emitter.on('reset', (val) => datadata.value = val);
</script>