Skip to content

交互式示例

vue
<script setup lang="tsx">
import { ref } from 'vue'

const props = withDefaults(
  defineProps<{
    foo?: string
    bar?: number
  }>(),
  { bar: 0 },
)

const emit = defineEmits<{
  increment: [value: number]
  decrement: []
}>()
emit('increment', 1)
emit('decrement')

const count = ref(0)

defineRender(<div>{count.value}</div>)
</script>