wechat_nuxt_001
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<style lang="scss" scoped>
|
||||
div.root-home {
|
||||
border: #a855f7 1px dashed;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="root-home">子组件</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// defineOptions({name: "zhong"});
|
||||
import {useVModel} from "@vueuse/core";
|
||||
|
||||
interface definePropsType {
|
||||
modelValue: number;// 对象类型的 prop
|
||||
}
|
||||
|
||||
// 2. 使用 withDefaults 定义默认值
|
||||
const props = withDefaults(defineProps<definePropsType>(), {});
|
||||
const emit = defineEmits<{
|
||||
(eventName: "update:modelValue", value: string): void
|
||||
}>();
|
||||
let data = useVModel(props, "modelValue", emit);
|
||||
</script>
|
||||
Reference in New Issue
Block a user