https://github.com/posrix/vue-dynamic-props
A Vue mixin to sync props to data in real-time
https://github.com/posrix/vue-dynamic-props
async javascript mixin props vue
Last synced: over 1 year ago
JSON representation
A Vue mixin to sync props to data in real-time
- Host: GitHub
- URL: https://github.com/posrix/vue-dynamic-props
- Owner: posrix
- License: mit
- Created: 2017-06-17T15:36:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T04:35:56.000Z (about 6 years ago)
- Last Synced: 2024-01-03T07:03:14.179Z (over 2 years ago)
- Topics: async, javascript, mixin, props, vue
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/vue-dynamic-props
- Size: 4.88 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# A Vue mixin to sync props to data in real-time
Real-time sync props to data. Useful when props receive async data that would change from time to time, and you also would like to mutate them rather than simply render them but to avoid the Vue warning.
## Install
```bash
yarn add vue-dynamic-props --dev
```
or npm
```bash
npm install vue-dynamic-props --save-dev
```
## Usage
Use default data key
```html
-
{{ item }}
import dynamicProps from 'vue-dynamic-props'
export default {
mixins: [
dynamicProps()
],
props: {
items: Array
}
}
```
Use a specified data key
```html
-
{{ item }}
import dynamicProps from 'vue-dynamic-props'
export default {
mixins: [
dynamicProps('yourKey')
],
props: {
items: Array
}
}
```
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.