Skip to content

Instantly share code, notes, and snippets.

@faforty
Created January 20, 2017 12:21
Show Gist options
  • Save faforty/91e41cd04a8f7f4ca022acebe7440139 to your computer and use it in GitHub Desktop.
Save faforty/91e41cd04a8f7f4ca022acebe7440139 to your computer and use it in GitHub Desktop.
<template>
<ui-label :filled="filled" :label-show="true">
<template slot="label"><slot></slot></template>
<textarea class="form-control ui-comment-field" v-model="message"></textarea>
</ui-label>
</template>
<script>
import uiLabel from './ui-label.vue';
export default {
components: {
uiLabel
},
watch: {
message (val) {
this.filled = val ? true : false
}
},
data: () => ({
message: '',
filled: false
})
}
</script>
@faforty
Copy link
Author

faforty commented Jan 20, 2017

<template>
  <ui-label :filled="filled" :label-show="true">
    <template slot="label"><slot></slot></template>
      <textarea class="form-control ui-comment-field" v-model="message"></textarea>
  </ui-label>
</template>
<script>
import uiLabel from './ui-label.vue';
export default {
    components: {
        uiLabel
    },
    watch: {
        message (val) {
            this.filled = val ? true : false
            this.$emit('input', val)
        }
    },
    data: () => ({
        message: '',
        filled: false
    })
}
</script>

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