Here I'm trying to create a 'type' props with values of HTML input type but it's of type string. Is there a way to do that except of creating enum by myself?
(property) HTMLInputElement.type: string Returns the content type of the object.
import Input from "./input/Input.vue";
interface SearchInputProps {
search: string;
placeholder?: string;
type?: HTMLInputElement["type"]; // still of type string
}
withDefaults(defineProps<SearchInputProps>(), {
placeholder: "Search",
type: "text",
});
const emit = defineEmits<{
(event: "search-input", input: string): void;
}>();
</script>