Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Selects and applies VueUse composables for Vue.js and Nuxt projects.
83% 96%+13 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 19 of 23 without it.
3 of 3 safety checks passed
35 agent runs
2 forksA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
Extended provide with ability to call injectLocal to obtain the value in the same component.
<script setup>
import { injectLocal, provideLocal } from '@vueuse/core'
provideLocal('MyInjectionKey', 1)
const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
</script>
export type ProvideLocalReturn = void
/**
* On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.
*
* @example
* ```ts
* provideLocal('MyInjectionKey', 1)
* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
* ```
*/
export declare function provideLocal<T, K = LocalProvidedKey<T>>(
key: K,
value: K extends InjectionKey<infer V> ? V : T,
): ProvideLocalReturn
Next to this one in the catalogue, plus more from the same author.