I have a vue composable that uses modals of type { [key: string]: boolean }
. My implement is shown below. However, I always get error as shown below the code. How can I fix this issue. Any information will be much appreciated.
export const useTable = <T extends { [key: string]: boolean }>(
url: string,
options: { modals: T } = {
modals: {
default: false,
media: false,
},
}
) => {}
Error
Type 'Ref<{ default: boolean; media: boolean; }>' is not assignable to type 'T'.