Currently, I am working with vue 2.6
and typescript 3.8.3
. The issue arises when I attempt to apply a validator to a prop.
I am encountering error message TS7006: Parameter 'props' implicitly has an 'any' type.
Below is the code snippet for my Vue single file component (SFC
):
<template>
<h1>{{propF}}</h1>
</template>
<script lang="ts">
import { defineComponent } from '@vue/composition-api'
export default defineComponent({
props:{
propF: {
type: String,
default: 'project',
validator: (value) => {
return ['project', 'global'].indexOf(value) !== -1
}
}
},
setup(props) {
return {
props
}
}
})
</script>