Closed
Description
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.