-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4d9ac9
commit 8a6ffd3
Showing
4 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
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,42 @@ | ||
<script setup lang="ts"> | ||
import { computed, ref } from "vue"; | ||
import ObsidianSetting from "../obsidian/ObsidianSetting.vue"; | ||
import ObsidianDropdown from "../obsidian/ObsidianDropdown.vue"; | ||
import ObsidianButton from "../obsidian/ObsidianButton.vue"; | ||
import { pluginSettings$ } from "@/stores/settings.store"; | ||
const { currentShelf } = defineProps<{ | ||
currentShelf: string; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(event: "close"): void; | ||
(event: "save", shelf: string): void; | ||
}>(); | ||
const selectedShelf = ref(currentShelf); | ||
const shelves = computed(() => { | ||
return Object.values(pluginSettings$.value.shelves).sort(); | ||
}); | ||
function save() { | ||
if (selectedShelf.value !== currentShelf) { | ||
emit("save", selectedShelf.value); | ||
} | ||
emit("close"); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ObsidianSetting name="Shelf"> | ||
<ObsidianDropdown v-model="selectedShelf"> | ||
<option value="">Not on a shelf</option> | ||
<option v-for="shelf in shelves" :key="shelf.name" :value="shelf.name">{{ shelf.name }}</option> | ||
</ObsidianDropdown> | ||
</ObsidianSetting> | ||
<ObsidianSetting> | ||
<ObsidianButton @click="$emit('close')">Cancel</ObsidianButton> | ||
<ObsidianButton cta @click="save">Save</ObsidianButton> | ||
</ObsidianSetting> | ||
</template> | ||
|
||
<style scoped></style> |
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