Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-mutable

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-mutable - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

dist/vue-mutable.js

2

package.json
{
"name": "vue-mutable",
"version": "1.1.0",
"version": "1.1.1",
"description": "Proxies your props into mutable local state.",

@@ -5,0 +5,0 @@ "main": "dist/vue-mutable.js",

@@ -14,11 +14,20 @@ # Vue Mutable

```js
// Installs a global mixin
import { VueMutable } from 'vue-mutable';
Vue.use(VueMutable);
// Or, use the mixin directly in your component
import { mutableProps } from 'vue-mutable';
export default {
mixins: [mutableProps]
...
}
```
## Before
# Why
If you need to modify a prop in a components local state, you need to do a few things:
1. Define the data property
1. Define a data property
2. Set the data property value to the prop value in a lifecycle hook

@@ -50,4 +59,2 @@ 3. Set a watcher for the prop so that if the parent updates the value, the internal value is synced

## After
Vue Mutable simplifies the process for you. Flag any prop as `mutable` and it will be accessible internally as a data property.

@@ -54,0 +61,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc