-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed so if stubble is burnt removed or retained you cannot have graze
- Loading branch information
Showing
6 changed files
with
79 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
"year": 2, | ||
"plant": 0, | ||
"stubble": 0, | ||
"graze": 0, | ||
"graze": null, | ||
"fertiliser": 200 | ||
}, | ||
{ | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="js"> | ||
import {onMounted, watch} from "vue"; | ||
const props = defineProps(['posibleValues', 'year', 'modelValue', 'name', 'nullify']); | ||
const emit = defineEmits(['update:modelValue']); | ||
let value = props.modelValue; | ||
onMounted(() => { | ||
if (props.nullify) { | ||
value = 'null' | ||
updateProperty('null'); | ||
} | ||
}); | ||
watch(() => props.nullify, (newValue, oldValue) => { | ||
if (props.nullify) { | ||
value = 'null' | ||
updateProperty('null'); | ||
} | ||
}, {immediate: true}); | ||
function updateProperty(value) { | ||
emit('update:modelValue', value); | ||
} | ||
</script> | ||
<template> | ||
<!-- value: {{ value }} props.nullify {{!props.nullify }}--> | ||
<div v-if="!nullify"> | ||
<el-select v-model="value" @change="updateProperty($event)"> | ||
<el-option v-for="obj in posibleValues" | ||
:key="props.year + props.name" | ||
:label="obj.name" | ||
:value="obj.id"/> | ||
</el-select> | ||
</div> | ||
</template> |