-
-
Save uno-de-piera/056ce3d244c94e38df0c97deb9df98ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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