Skip to content

323 - Prop验证 #2892

@cone41

Description

@cone41
<script setup>
defineProps({
  type: {
    type: String,
    validator: (val) => {
      return ['primary', 'ghost' , 'dashed' , 'link' , 'text' , 'default'].includes(val)
    },
    default:'default'
  },
})
</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