New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vue-setstate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-setstate

Optimizing Vue big data processing

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

vue-setState Build Status npm package

Using React style setState method in Vue, Apply to optimize rendering speed of big data

Install

$ npm i vue-setstate -S

CDN: UNPKG | jsDelivr

Usage

import Vue from 'vue'
import setState from 'vue-setstate'

Vue.use(setState)

Then in your component:

<script>
export default {
  state: {
    // your data here
    name: 'tom'
  },

  methods: {
    changeMyName () {
      this.setState({ name: 'mary' })
    },
    changeMyNameWithFunctionalParam () {
      this.setState(({ name }) => ({
        name: `Hi ${name}`
      }))
    }
  }
}
</script>

Warning: state is not reactive!, you must use setState method if you want to change the view.

License

MIT

Copyright (c) 2017-present, Army-U

Keywords

Vue

FAQs

Package last updated on 15 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts