dynamize inspirations selector
This commit is contained in:
parent
b048d3d43f
commit
38eb9cf35e
2 changed files with 14 additions and 5 deletions
|
|
@ -10,8 +10,9 @@
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
id="inspirations-select"
|
id="inspirations-select"
|
||||||
v-model="current.uri"
|
v-model="current"
|
||||||
:options="all"
|
:options="all"
|
||||||
|
optionLabel="title"
|
||||||
class="font-serif"
|
class="font-serif"
|
||||||
data-icon="chevron-single-down"
|
data-icon="chevron-single-down"
|
||||||
checkmark
|
checkmark
|
||||||
|
|
@ -29,13 +30,13 @@ const { all } = defineProps({
|
||||||
const current = ref(all[0]);
|
const current = ref(all[0]);
|
||||||
|
|
||||||
watch(current, (newValue) => {
|
watch(current, (newValue) => {
|
||||||
console.log(newValue);
|
changeInspiration(newValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["update:currentInspiration"]);
|
const emit = defineEmits(["update:currentInspiration"]);
|
||||||
|
|
||||||
function changeInspiration(inspirationUri) {
|
function changeInspiration(inspiration) {
|
||||||
emit("update:currentInspiration", inspirationUri);
|
emit("update:currentInspiration", inspiration);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@
|
||||||
<main>
|
<main>
|
||||||
<h2 id="tabslist" class="sr-only">Inspirations</h2>
|
<h2 id="tabslist" class="sr-only">Inspirations</h2>
|
||||||
<Tabs :tabs="tabs" @update:currentTab="changeTab" />
|
<Tabs :tabs="tabs" @update:currentTab="changeTab" />
|
||||||
<Selector :all="page.inspirations" />
|
<Selector
|
||||||
|
:all="page.inspirations"
|
||||||
|
@update:currentInspiration="changeInspiration"
|
||||||
|
/>
|
||||||
<section :id="currentTab" class="inspiration">
|
<section :id="currentTab" class="inspiration">
|
||||||
<Header :inspiration="currentInspiration" />
|
<Header :inspiration="currentInspiration" />
|
||||||
<div class="masonry flow">
|
<div class="masonry flow">
|
||||||
|
|
@ -63,6 +66,11 @@ const favoriteImages = computed(() => {
|
||||||
function changeTab(newValue) {
|
function changeTab(newValue) {
|
||||||
currentTab.value = newValue;
|
currentTab.value = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeInspiration(newValue) {
|
||||||
|
console.log(newValue);
|
||||||
|
currentInspiration.value = newValue;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue