use v model in custom component

Solutions on MaxInterview for use v model in custom component by the best coders in the world

showing results for - "use v model in custom component"
Elizabeth
26 Jan 2016
1/******************/
2/* CUSTOM ELEMENT */
3/******************/
4<template>
5	<!-- Everithing you whant -->
6	<input :value="value" @input="$emit('input',$event.target.value)"/>
7</template>
8
9<script>
10export default {
11	name: "CustomElement",
12	props: {
13    	value: {
14			type: String,
15			default: ""
16		}
17	}
18}
19</script>
20
21/******************/
22/* PARENT ELEMENT */
23/******************/
24<CustomElement v-model="someVariable" />