From 18cb5aa37ef8d38a02683a811611b188bb3b84da Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Sun, 23 May 2021 00:11:20 +0800 Subject: [PATCH] global token --- web/index.html | 3 ++- web/index.js | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/web/index.html b/web/index.html index fd5c2fa..ec0ec4a 100644 --- a/web/index.html +++ b/web/index.html @@ -19,10 +19,11 @@
- +
diff --git a/web/index.js b/web/index.js index a0ec6fa..51d8974 100644 --- a/web/index.js +++ b/web/index.js @@ -124,9 +124,11 @@ const component_search_folders = { } const component_manage= { + props: ['token'], + emits: ['set_token'], data() { return { - token: "", + token_tmp: "", root: "", pattern: [".flac", ".mp3"], pattern_tmp: "", @@ -139,7 +141,7 @@ const component_manage= { Token - + Root @@ -168,6 +170,9 @@ const component_manage= { `, methods: { + emit_set_token() { + this.$emit('set_token', this.token_tmp) + }, add_pattern() { this.pattern.push(this.pattern_tmp) this.pattern_tmp = "" @@ -464,9 +469,13 @@ const app = Vue.createApp({ data() { return { playing_audio_file: {}, + token: "default token", } }, methods: { + set_token(token) { + this.token = token + }, play_audio(file) { console.log(file) this.playing_audio_file = file