Skip to content

Commit

Permalink
fix(vue-challenges): props validation
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 29, 2022
1 parent dc4a1d8 commit feadcf3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.

This file was deleted.

17 changes: 17 additions & 0 deletions packages/vue-challenges/solutions/323-prop-validation/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script setup>
defineProps({
type: {
type: String,
default: 'default',
validator(value) {
return ['primary', 'ghost', 'dashed', 'link', 'text', 'default'].includes(
value
);
},
},
});
</script>

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

0 comments on commit feadcf3

Please sign in to comment.