Fix vehicle page, remove base input v-validate

This commit is contained in:
Scott Kiener 2024-08-27 15:21:22 -04:00
parent 6b18a3d23a
commit 3e210b006a
3 changed files with 23 additions and 5 deletions

View file

@ -17,7 +17,6 @@
:aria-required="isRequired"
:value="value"
:checked="isChecked"
v-validate="''"
@keypress.space="handleEventAction(eventTypes.SPACE, $event)"
@keypress.enter="handleEventAction(eventTypes.ENTER, $event)"
@change="handleEventAction(eventTypes.CHANGE, $event)" />
@ -49,13 +48,20 @@ export default {
};
},
mounted() {
console.log('mounted');
// Need this here and in the watch for vehicle-parts, unless there'a better way
if (this.isChecked) {
console.log('I was checked');
this.handleChange(this.modelValue);
}
},
methods: {
test() {
console.log('A');
},
handleEventAction(eventType, e) {
console.log('handleEventAction');
console.log(eventType);
if (this.isMultiSelect) {
switch (eventType) {
case this.eventTypes.CHANGE:
@ -80,6 +86,7 @@ export default {
}
},
handleSelectionChange(e) {
console.log("handleSelectionChange");
if (
this.isMultiSelect &&
(this.modelValue instanceof Array || this.modelValue == null)
@ -99,6 +106,7 @@ export default {
this.handleChange(this.valueToEmit);
},
handleClick(e) {
console.log('handleClick');
this.handleSelectionChange(e);
this.$emit("update:modelValue", this.valueToEmit);
},

View file

@ -75,8 +75,13 @@ export default {
: [];
return filteredAnswers.map((ans) => {
const newName = ans.Name.includes("-") ? ans.Name.split("-")[1] : ans.Name;
ans.Name = newName;
return ans;
return {
Name: newName,
AnswerImageUrl: ans.AnswerImageUrl,
ImageId: ans.ImageId,
SubText: ans.SubText,
Text: ans.Text,
};
});
},
},

View file

@ -142,8 +142,13 @@ export default {
return filteredAnswers.map((ans) => {
const newName = ans.Name.includes("-") ? ans.Name.split("-")[1] : ans.Name;
ans.Name = newName;
return ans;
return {
Name: newName,
AnswerImageUrl: ans.AnswerImageUrl,
ImageId: ans.ImageId,
SubText: ans.SubText,
Text: ans.Text,
};
});
},
isDriverSideReplaceOptionsQuestionAvailable() {