Skip to content

Pinia unwrapping ref in class, causing type mismatch #2192

Discussion options

You must be logged in to vote

I figured out the solution... The type decalaration of the composable should be:

import { UnwrapNestedRefs } from 'vue';

const useSayChipModel = (chip: UnwrapNestedRefs<Chip>) => {
  const say = () => {
    console.log(chip.model)
  }
  return {
    say
  }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JerryChan31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant