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:
@@ -5,30 +5,18 @@
|
||||
<img v-if="isChecked" :src="ImgCheckboxBlueFrame" class="absolute" alt="checkbox"/>
|
||||
<img v-if="isChecked" :src="ImgCheckboxCheckedMark" class="absolute top-[11x] left-[2px] h-[16px] w-[14px]" alt="checkbox"/>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent, computed, } from 'vue';
|
||||
<script setup>
|
||||
import ImgCheckboxBlueFrame from "@/assets/icon-blue-checkbox.svg";
|
||||
import ImgCheckboxCheckedMark from "@/assets/icon-checkbox-checked.svg";
|
||||
import ImgCheckboxGrayFrame from "@/assets/icon-checkbox-empty.svg";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
isChecked: {
|
||||
defineProps({
|
||||
isChecked: {
|
||||
type: Boolean,
|
||||
required: true // 表示这个 props 是必需的
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const isChecked = computed(() => props.isChecked);
|
||||
return {
|
||||
ImgCheckboxBlueFrame,
|
||||
ImgCheckboxCheckedMark,
|
||||
ImgCheckboxGrayFrame,
|
||||
isChecked,
|
||||
};
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user