Skip to content

323 - Prop Validation #2946

Open
Open
@zjx-git

Description

@zjx-git
// your answers
// 改用ts写法吧, vue原生的约束语法记忆负担太大
<script setup lang="ts">
import { withDefaults } from 'vue'
withDefaults(defineProps<{
  type: 'primary' | 'ghost' | 'dashed' | 'link' | 'text' | 'default'
}>(), {
  type: 'primary'
})

</script>

<template>
  <button>Button</button>
</template>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions