Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active February 4, 2019 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/056ce3d244c94e38df0c97deb9df98ff to your computer and use it in GitHub Desktop.
Save uno-de-piera/056ce3d244c94e38df0c97deb9df98ff to your computer and use it in GitHub Desktop.
<template>
<b-row :class="this.classes">
<b-col cols="6" class="mt-2"><label>{{ this.label }}</label></b-col>
<b-col class="w-100"><b-form-input :max="100" :min="1" v-model="prop" type="number" size="xs"></b-form-input></b-col>
</b-row>
</template>
<script>
export default {
name: 'SupportFormBaseInput',
props: {
supportObject: {
type: Object,
required: true
}
},
computed: {
prop: {
get () {
return this.inputValue
},
set (val) {
const data = {
[this.supportObjectKey]: val,
support_object_id: this.supportObject.id,
key: this.supportObjectKey
}
this.$store.commit(this.mutation, data, {root: true})
}
},
}
}
</script>
<script>
import SupportFormBaseInput from './SupportFormBaseInput'
export default {
name: 'SupportFormInputReporter',
extends: SupportFormBaseInput, //heredamos del componente SupportFormBaseInput!
data () {
return {
classes: 'text-left',
inputValue: this.supportObject.reporter,
supportObjectKey: 'reporter',
mutation: 'supportForm/setReporter',
label: 'Reporter:'
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment