Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wagerfield/vue-static-data
Add static data to Vue instances
https://github.com/wagerfield/vue-static-data
Last synced: about 2 months ago
JSON representation
Add static data to Vue instances
- Host: GitHub
- URL: https://github.com/wagerfield/vue-static-data
- Owner: wagerfield
- License: mit
- Created: 2019-02-08T10:56:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T03:01:10.000Z (almost 2 years ago)
- Last Synced: 2024-09-17T05:18:36.017Z (3 months ago)
- Language: JavaScript
- Size: 548 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Vue Static Data
Add `staticData` to [Vue instances][vue-instances] and watch in awe as it does nothing.
yarn add vue-static-data
```vue
export default {
// Object | Function
staticData: () => ({
staticProp: "static"
}),
data: () => ({
reactiveProp: "reactive"
}),
methods: {
updateStatic() {
this.staticProp = "static clicked"
},
updateReactive() {
this.reactiveProp = "reactive clicked"
}
}
}```
## Author
[Matthew Wagerfield][github]
## License
[MIT][mit]
[vue-instances]: https://vuejs.org/v2/guide/instance
[mit]: https://opensource.org/licenses/MIT
[github]: https://github.com/wagerfield