<template>
<h1>badge</h1>
  <div>{{title}}</div>
 <div>{{count}} </div> 
</template>

<script lang="ts" setup>
defineOptions({
  name: "SjfBadge",
});
console.log("11111")
import {
  reactive,
  onBeforeMount,
  onMounted,
  defineProps,
} from "vue";

// props的接口 约定props传递的参数格式
/* interface Props {
  title: string;
  count?:number,
  obj:{a:number}
}
const props = withDefaults(defineProps<Props>(), {
  title: "hello",
  count: 1,
  obj:()=>{
    return {a:2}
  }
}); */
const props = defineProps({
  title: {
    type: String,
    default: "",
  },
  count: {
    type:String,
    default:''
  },
  obj: Object,
});

const data = reactive({});
console.log("11111")
onBeforeMount(() => {});
onMounted(() => {
  console.log("props数据",props,props.title,props.count,props.obj)
});
</script>

<style scoped lang="scss"></style>
