Skip to content

323 - Prop Validation #2946

@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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zjx-git

        Issue actions

          323 - Prop Validation · Issue #2946 · webfansplz/vuejs-challenges