Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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