Skip to content

Commit

Permalink
fix: #415
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Nov 27, 2024
1 parent 3054ac1 commit 716c97d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/sentence/AttributeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
:options-sanitize="true"
@input-value="onInput()"
/>
<q-select v-else v-model="props.row.a" dense ble borderless :options="computeAttributeOptions()" />
<q-select v-else v-model="props.row.a" dense borderless :options="computeAttributeOptions()" @update:model-value="computeValue(props.row)" />
</q-td>

<q-td key="v" :props="props">
Expand All @@ -61,7 +61,7 @@
/>
<q-select
v-else-if="computeValueOptions(props.row) !== undefined && computeValueOptions(props.row).length ===1"
v-model="computeValueOptions(props.row)[0]"
v-model="props.row.v"
dense
filled
readonly
Expand Down Expand Up @@ -152,6 +152,11 @@ export default defineComponent({
computeValueOptions(row: any) {
return (this.featPossibleOptions.filter((x) => x.name === row.a)[0] || {}).values;
},
computeValue(row: any) {
if (this.computeValueOptions(row).length === 1) {
row.v = this.computeValueOptions(row)[0];
}
},
computeValueType(row: any) {
const possibleValue = (this.featPossibleOptions.filter((x) => x.name === row.a)[0] || {}).values;
if (possibleValue && possibleValue instanceof Array) return possibleValue;
Expand Down

0 comments on commit 716c97d

Please sign in to comment.