using v-show

This commit is contained in:
sanjayk03-dev
2024-01-28 17:29:04 +05:30
parent 834e782463
commit b71e78eb5b
2 changed files with 4 additions and 2 deletions

View File

@@ -61,7 +61,9 @@ module.exports = {
const response = await fetch(`/api/file/EgZjaHJvbWUqCggBEAAYsQMYgAQyBggAEEUYOTIKCAE${file}`, { const response = await fetch(`/api/file/EgZjaHJvbWUqCggBEAAYsQMYgAQyBggAEEUYOTIKCAE${file}`, {
cache: "no-cache", cache: "no-cache",
}); });
console.log('response: ',response);
const text = (await response.text()).split(" ").join("\n"); const text = (await response.text()).split(" ").join("\n");
console.log('text: ',text);
this.$set("newGcode[this.tab]", text); this.$set("newGcode[this.tab]", text);
} else { } else {
this.$set("newGcode[this.tab]", ""); this.$set("newGcode[this.tab]", "");

View File

@@ -38,9 +38,9 @@ script#macros-template(type="text/x-template")
.tabs .tabs
input(type="radio",v-for="(index,macros) in config.macros",:id="'tab'+index", input(type="radio",v-for="(index,macros) in config.macros",:id="'tab'+index",
:name="'tab'+index", @click="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 .macros-form
p.title Name p.title Name
.input-container .input-container