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

View file

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