https://github.com/hojas/vue-use-context
Get Vue globalProperties easily in setup.
https://github.com/hojas/vue-use-context
context vue
Last synced: 4 months ago
JSON representation
Get Vue globalProperties easily in setup.
- Host: GitHub
- URL: https://github.com/hojas/vue-use-context
- Owner: hojas
- License: mit
- Created: 2023-07-26T09:30:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-27T01:51:58.000Z (almost 2 years ago)
- Last Synced: 2025-03-13T05:33:56.569Z (4 months ago)
- Topics: context, vue
- Language: TypeScript
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-use-context
 
Get Vue globalProperties easily in setup.
## Install
```shell
$ npm install vue-use-context
```## Use
main.ts
```ts
import { createApp } from 'vue'
import App from './App.vue'const app = createApp(App)
app.config.globalProperties.$name = 'name'app.mount('#app')
```App.vue
```vue
import { useContext } from 'vue-use-context'
const { $name } = useContext()
{{ $name }}```