vue-use-forward-ref 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/package.json +15 -17
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# vue-
|
|
1
|
+
# vue-use-forward-ref
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.com/package/vue-use-forward-ref) [](https://github.com/refinist/vue-use-forward-ref/actions/workflows/unit-test.yml) [](https://codecov.io/github/refinist/vue-use-forward-ref) [](https://unpkg.com/vue-use-forward-ref)
|
|
4
4
|
|
|
5
5
|
A lightweight Vue 3 composable to forward component ref and merge the child's exposed API onto the parent instance. Parent's ref then exposes both the child's `expose()` and optional extra fields in one place.
|
|
6
6
|
|
|
@@ -15,16 +15,16 @@ A lightweight Vue 3 composable to forward component ref and merge the child's ex
|
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
# npm
|
|
18
|
-
npm install vue-
|
|
18
|
+
npm install vue-use-forward-ref
|
|
19
19
|
|
|
20
20
|
# yarn
|
|
21
|
-
yarn add vue-
|
|
21
|
+
yarn add vue-use-forward-ref
|
|
22
22
|
|
|
23
23
|
# pnpm
|
|
24
|
-
pnpm add vue-
|
|
24
|
+
pnpm add vue-use-forward-ref
|
|
25
25
|
|
|
26
26
|
# bun
|
|
27
|
-
bun add vue-
|
|
27
|
+
bun add vue-use-forward-ref
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## 🚀 Basic Usage
|
|
@@ -40,7 +40,7 @@ Use `forwardRef` as the child's `ref`. The parent's ref (e.g. from a grandparent
|
|
|
40
40
|
|
|
41
41
|
<script setup lang="ts">
|
|
42
42
|
import { ref } from 'vue';
|
|
43
|
-
import { useForwardRef } from 'vue-
|
|
43
|
+
import { useForwardRef } from 'vue-use-forward-ref';
|
|
44
44
|
import Child from './Child.vue';
|
|
45
45
|
|
|
46
46
|
const { forwardRef } = useForwardRef();
|
|
@@ -60,7 +60,7 @@ You can merge additional fields onto the exposed object so the parent ref sees b
|
|
|
60
60
|
|
|
61
61
|
<script setup lang="ts">
|
|
62
62
|
import { ref } from 'vue';
|
|
63
|
-
import { useForwardRef } from 'vue-
|
|
63
|
+
import { useForwardRef } from 'vue-use-forward-ref';
|
|
64
64
|
import Child from './Child.vue';
|
|
65
65
|
|
|
66
66
|
const count = ref(0);
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-use-forward-ref",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"packageManager": "pnpm@10.30.3",
|
|
4
|
+
"version": "0.0.1",
|
|
6
5
|
"description": "A lightweight Vue 3 composable to forward component ref and merge child exposed API onto parent instance",
|
|
7
6
|
"author": "REFINIST",
|
|
8
7
|
"license": "MIT",
|
|
9
|
-
"homepage": "https://github.com/refinist/vue-
|
|
8
|
+
"homepage": "https://github.com/refinist/vue-use-forward-ref#readme",
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/refinist/vue-
|
|
11
|
+
"url": "git+https://github.com/refinist/vue-use-forward-ref.git"
|
|
13
12
|
},
|
|
14
13
|
"bugs": {
|
|
15
14
|
"url": "https://github.com/refinist/vue-forwardref/issues"
|
|
@@ -36,18 +35,6 @@
|
|
|
36
35
|
"engines": {
|
|
37
36
|
"node": ">=20.19.0"
|
|
38
37
|
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "tsdown",
|
|
41
|
-
"lint": "eslint --cache .",
|
|
42
|
-
"lint:fix": "pnpm run lint --fix",
|
|
43
|
-
"format": "prettier --cache --write .",
|
|
44
|
-
"prepublishOnly": "pnpm run build",
|
|
45
|
-
"release": "bumpp && pnpm publish",
|
|
46
|
-
"test": "vitest run",
|
|
47
|
-
"test:coverage": "vitest run --coverage",
|
|
48
|
-
"test:watch": "vitest",
|
|
49
|
-
"typecheck": "tsgo --noEmit"
|
|
50
|
-
},
|
|
51
38
|
"peerDependencies": {
|
|
52
39
|
"vue": ">=3"
|
|
53
40
|
},
|
|
@@ -72,5 +59,16 @@
|
|
|
72
59
|
"publishConfig": {
|
|
73
60
|
"access": "public",
|
|
74
61
|
"registry": "https://registry.npmjs.org/"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsdown",
|
|
65
|
+
"lint": "eslint --cache .",
|
|
66
|
+
"lint:fix": "pnpm run lint --fix",
|
|
67
|
+
"format": "prettier --cache --write .",
|
|
68
|
+
"release": "bumpp",
|
|
69
|
+
"test": "vitest run",
|
|
70
|
+
"test:coverage": "vitest run --coverage",
|
|
71
|
+
"test:watch": "vitest",
|
|
72
|
+
"typecheck": "tsgo --noEmit"
|
|
75
73
|
}
|
|
76
|
-
}
|
|
74
|
+
}
|