Skip to content

Instantly share code, notes, and snippets.

View cjcrawford's full-sized avatar

Conan Crawford cjcrawford

  • Charlotte, NC
View GitHub Profile
@cjcrawford
cjcrawford / VueBinding.vue
Created August 26, 2018 18:56
Vue Binding Example
<template>
<input ref="input" v-model="localValue" @change="handleChange">
</template>
<script>
export default {
data: () => ({
localValue: null
}),
props: ['value'],
methods: {
@cjcrawford
cjcrawford / DatePickerVue.vue
Last active November 25, 2018 05:22
DatePicker
<template>
<div>
<input ref="input" type="text" v-model="localValue" />
<slot :localValue="localValue" :formattedDate="formattedDate">
{{ formattedDate }}
</slot>
<!-- parent can now use 'render prop through scoped slot' -->
<!--
<DatePickerComponent slot-scope="{localValue, formattedDate}" :value="value" @input="handleChildInput" @clear="clearChildInput">
{{ formattedDate }}