Skip to content

Interactive Example

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>