Appearance
defineProps
▸ defineProps<T
>(props
): TypeFromShape
<T
, unknown
>
Type parameters
Name | Type |
---|---|
T | extends Record <string , Schema <any , any , any , "" >> |
参数
Name | Type |
---|---|
props | T |
返回值
TypeFromShape
<T
, unknown
>
示例
ts
import {createFaaS, defineProps} from '@ifanrx/faas'
import {number, string} from 'yup'
export default createFaaS(() => {
const props = defineProps({
name: string().required(),
age: number(),
})
console.log(props)
return 'success'
})