Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

vue-static-data

0.4.0 • Public • Published

Vue Static Data

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

yarn add vue-static-data

Setup

import Vue from "vue"
import VueStaticData from "vue-static-data"
 
Vue.use(VueStaticData)

Usage

<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

Install

npm i vue-static-data

DownloadsWeekly Downloads

19

Version

0.4.0

License

MIT

Unpacked Size

3.36 kB

Total Files

4

Last publish

Collaborators

  • avatar