This commit is contained in:
@@ -4,17 +4,16 @@ import { AddContextMenu, HideContextMenu } from '@/services/ContextMenu';
|
||||
const props = defineProps(['options', 'onselect', 'selected', 'keyFunc']);
|
||||
const options = props.options;
|
||||
const selectCallback = props.onselect;
|
||||
|
||||
const initialSelect = props.selected;
|
||||
const dropdown = ref(null);
|
||||
|
||||
const selected = ref(initialSelect);
|
||||
const selected = ref(null);
|
||||
|
||||
onMounted(() => {
|
||||
if(props.keyFunc == undefined) props.keyFunc = (option) => option;
|
||||
else selected.value = props.keyFunc(initialSelect);
|
||||
|
||||
selected.value = props.keyFunc(initialSelect);
|
||||
|
||||
let context = [];
|
||||
if(props.selected == undefined) selected.value = "undefined";
|
||||
watch(() => props.selected, () => {
|
||||
selected.value = props.keyFunc(props.selected);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user