https://github.com/mitscherlich/vue-forward-ref
Portal `React.forwardRef` api into Vue
https://github.com/mitscherlich/vue-forward-ref
Last synced: about 1 year ago
JSON representation
Portal `React.forwardRef` api into Vue
- Host: GitHub
- URL: https://github.com/mitscherlich/vue-forward-ref
- Owner: Mitscherlich
- License: mit
- Created: 2024-03-27T16:33:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-01T21:46:10.000Z (about 1 year ago)
- Last Synced: 2025-07-01T22:29:56.619Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://npm.im/v-forward-ref
- Size: 443 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# v-forward-ref
[](https://npm.im/v-forward-ref) [](https://npm.im/v-forward-ref)
## Install
via `pnpm`, `yarn` or `npm`:
```bash
pnpm add v-forward-ref
# or
yarn add v-forward-ref
# or
npm i -S v-forward-ref
```
## How to use
```typescript
import { forwardRef } from 'v-forward-ref'
const Comp = defineComponent((props, ctx) => {
ctx.expose({ foo: 'bar' })
return () =>
{props.message}
})
const Wrap = forwardRef((props, { slots }, ref) => {
return
})
const App = defineComponent(() => {
const cmpRef = ref(null)
onMounted(() => {
console.log(cmpRef.value.foo) // => 'bar'
})
return () =>
})
```
## License
MIT © [Mitscherlich](https://mitscherlich.me)