An open API service indexing awesome lists of open source software.

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

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.