Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$props #4571

Closed
Akryum opened this issue Dec 26, 2016 · 0 comments
Closed

$props #4571

Akryum opened this issue Dec 26, 2016 · 0 comments

Comments

@Akryum
Copy link
Member

Akryum commented Dec 26, 2016

A $props special attribute would be very handy to reuse generic components inside more specific ones. It would hold the props passed down to the component.

For example, I'd like to create a InputModal which would be a Modal with some predefined content (for example,one <input/>).

<template>
  <modal v-bind="$props">
    <input v-model="inputValue" :placeholder="placeholder" />
  </modal>
</template>

<script>
import Modal from './Modal.vue'

export default {
  props: {
    ...Modal.props,
    value: {},
    placeholder: String,
  },

  // ...
}
</script>

Here is a jsfiddle of the use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants