Skip to content

wagerfield/vue-static-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Static Data

Add staticData to Vue instances and watch in awe as it does nothing.

yarn add vue-static-data
<template>
  <div>
    <button @click="updateStatic" v-text="staticProp" />
    <button @click="updateReactive" v-text="reactiveProp" />
  </div>
</template>

<script>
export default {
  // Object | Function
  staticData: () => ({
    staticProp: "static"
  }),
  data: () => ({
    reactiveProp: "reactive"
  }),
  methods: {
    updateStatic() {
      this.staticProp = "static clicked"
    },
    updateReactive() {
      this.reactiveProp = "reactive clicked"
    }
  }
}
</script>

Author

Matthew Wagerfield

License

MIT

About

Add static data to Vue instances

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published