break down search component into smaler components

This commit is contained in:
geoffrey45
2022-01-23 10:27:39 +03:00
parent 7945c04a06
commit 7689f13fdc
16 changed files with 596 additions and 469 deletions
+62
View File
@@ -0,0 +1,62 @@
<template>
<div class="options" v-if="magic_flag">
<div class="item info">Filter by:</div>
<div
class="item"
v-for="option in options"
:key="option"
@click="addFilter(option.icon)"
>
{{ option.title }}
</div>
</div>
</template>
<script>
export default {
props: ["magic_flag"],
setup(props, { emit }) {
const options = [
{
title: "🎵 Track",
icon: "🎵",
},
{
title: "💿 Album",
icon: "💿",
},
{
title: "🙄 Artist",
icon: "🙄",
},
{
title: "😍 Playlist",
icon: "😍",
},
{
title: "📁 Folder",
icon: "📁",
},
];
function addFilter(value) {
emit("addFilter", value);
}
return {
options,
addFilter,
};
},
};
</script>
<style lang="scss">
.right-search .options {
display: flex;
.item {
margin: $small;
}
}
</style>