mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-07-29 06:02:06 +00:00
[client] update modal to take props
This commit is contained in:
parent
e8994ce9ae
commit
9ada6c9058
@ -6,6 +6,7 @@
|
|||||||
<div class="cancel image" @click="modal.hideModal"></div>
|
<div class="cancel image" @click="modal.hideModal"></div>
|
||||||
<NewPlaylist
|
<NewPlaylist
|
||||||
v-if="modal.component == modal.options.newPlaylist"
|
v-if="modal.component == modal.options.newPlaylist"
|
||||||
|
:track="modal.props.track"
|
||||||
@hideModal="hideModal"
|
@hideModal="hideModal"
|
||||||
@title="title"
|
@title="title"
|
||||||
/>
|
/>
|
||||||
@ -38,7 +39,7 @@ function hideModal() {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.new-playlist-modal {
|
.new-playlist-modal {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 2000;
|
z-index: 20;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
|
import { Track } from "../interfaces";
|
||||||
enum ModalOptions {
|
enum ModalOptions {
|
||||||
newPlaylist = "newPlaylist",
|
newPlaylist = "newPlaylist",
|
||||||
editPlaylist = "editPlaylist",
|
editPlaylist = "editPlaylist",
|
||||||
@ -10,6 +10,7 @@ export default defineStore("newModal", {
|
|||||||
title: "",
|
title: "",
|
||||||
options: ModalOptions,
|
options: ModalOptions,
|
||||||
component: "",
|
component: "",
|
||||||
|
props: {},
|
||||||
visible: false,
|
visible: false,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
@ -17,6 +18,11 @@ export default defineStore("newModal", {
|
|||||||
this.component = modalOption;
|
this.component = modalOption;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
},
|
},
|
||||||
|
showNewPlaylistModal(track: Track) {
|
||||||
|
this.component = ModalOptions.newPlaylist;
|
||||||
|
this.props.track = track;
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user