Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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