From b71e78eb5b18e638801b2d8dc7afb92ed8acb955 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Sun, 28 Jan 2024 17:29:04 +0530 Subject: [PATCH] using v-show --- src/js/macros.js | 2 ++ src/pug/templates/macros.pug | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index c1ba49f..9791973 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -61,7 +61,9 @@ module.exports = { const response = await fetch(`/api/file/EgZjaHJvbWUqCggBEAAYsQMYgAQyBggAEEUYOTIKCAE${file}`, { cache: "no-cache", }); + console.log('response: ',response); const text = (await response.text()).split(" ").join("\n"); + console.log('text: ',text); this.$set("newGcode[this.tab]", text); } else { this.$set("newGcode[this.tab]", ""); diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 058b47d..fc8c716 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -38,9 +38,9 @@ script#macros-template(type="text/x-template") .tabs input(type="radio",v-for="(index,macros) in config.macros",:id="'tab'+index", :name="'tab'+index", @click="tab=index") - label(v-for="(index,macros) in config.macros",:for="'tab'+index",style="height:50px;width:100px",:key="index") Macros {{index+1}} + label(v-for="(index,macros) in config.macros",:for="'tab'+index",style="height:50px;width:100px") Macros {{index+1}} - section.tab-content(v-for="(index,macros) in config.macros",:id="'content'+index" ,:checked="index==0") + section.tab-content(v-for="(index,macros) in config.macros",:id="'content'+index" ,v-show="tab === index") .macros-form p.title Name .input-container