TypeScript and Types
To use types in a TypeScript project, add "vs-vue3-select" to the "types" section in the tsconfig.json file:
{
"compilerOptions": {
"types": [
"vs-vue3-select"
]
}
}
Afterwards, you can import them as needed. For example:
<template>
<div id="app">
<div>
<v-select :options="['test','test1']" :createOption="foo"/>
</div>
</div>
</template>
<script lang="ts" setup>
import type {CreateOptionFunction} from "vs-vue3-select";
const foo: CreateOptionFunction = (value: string | number): object => {
return {label: value}
};
</script>