85 lines
No EOL
2.3 KiB
Vue
85 lines
No EOL
2.3 KiB
Vue
<template>
|
|
<addressQuestions ref="addressQuestions" v-model="customerModel.addressQuestions" />
|
|
<div class="row my-4">
|
|
<div class="col">
|
|
<textboxQuestion v-model="customerModel.firstName" ref="firstName" inputId="08497a2efd9a4a73a70360ab47b4838d" disableAutoFill />
|
|
</div>
|
|
</div>
|
|
<div class="row my-4">
|
|
<div class="col">
|
|
<textboxQuestion v-model="customerModel.lastName" ref="lastName" inputId="0030e56a57e74a4ab92de7fb8e97fec5" disableAutoFill />
|
|
</div>
|
|
</div>
|
|
<div class="row my-4">
|
|
<div class="col">
|
|
<textboxQuestion v-model="customerModel.emailAddress" ref="emailAddress" inputId="00450a91b8964a768ce3992e6feb890f" disableAutoFill />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
|
import textboxQuestion from "@/common-components/textbox-question/textbox-question";
|
|
import { computed } from 'vue';
|
|
//import store from "@/store";
|
|
|
|
export default ({
|
|
name: "customer-questions",
|
|
emits: ['update:modelValue'], // The component emits an event
|
|
props: {
|
|
modelValue: {
|
|
type: Object,
|
|
default: () => ({
|
|
customerQuestions: {
|
|
addressQuestions: {
|
|
streetAddress: "",
|
|
city: "",
|
|
state: "",
|
|
zip: "",
|
|
},
|
|
firstName: "",
|
|
lastName: "",
|
|
emailAddress: "",
|
|
}
|
|
}),
|
|
}
|
|
},
|
|
data(){
|
|
return {
|
|
|
|
}
|
|
},
|
|
setup(props, { emit }) {
|
|
const customerModel = computed({ // Use computed to wrap the object
|
|
get: () => props.modelValue,
|
|
set: (value) => emit('update:modelValue', value),
|
|
});
|
|
|
|
return { customerModel };
|
|
},
|
|
methods: {
|
|
initializeComponent(cmsContent){
|
|
// pass alert texts to addressQuestions component
|
|
this.$refs.addressQuestions.initializeComponent(cmsContent);
|
|
|
|
this.$refs.firstName.initializeComponent(cmsContent[6].QuestionText);
|
|
this.$refs.lastName.initializeComponent(cmsContent[7].QuestionText);
|
|
this.$refs.emailAddress.initializeComponent(cmsContent[8].QuestionText);
|
|
}
|
|
},
|
|
computed: {
|
|
value: {
|
|
get: function() {
|
|
return this.modelValue;
|
|
},
|
|
set: function(newValue) {
|
|
this.$emit("update:modelValue", newValue);
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
addressQuestions,
|
|
textboxQuestion,
|
|
}
|
|
})
|
|
</script> |