Commit 8813e07e authored by chenqikuai's avatar chenqikuai

perf: 点击模板时请求数据,而不是点击预览时请求数据。这样点击预览时能立刻展示预览内容。

parent 130c09ba
...@@ -47,14 +47,13 @@ export default class Index extends Vue { ...@@ -47,14 +47,13 @@ export default class Index extends Vue {
return this.selectedId !== null; return this.selectedId !== null;
} }
handleClickItem(id: number) { async handleClickItem(id: number) {
this.selectedId = id; this.selectedId = id;
const ret = await this.$api.template.get(id);
this.detail = JSON.parse(ret.detail);
} }
async handleClickPreview() { async handleClickPreview() {
const id = this.selectedId;
const ret = await this.$api.template.get(id);
this.detail = JSON.parse(ret.detail);
this.previewVisible = true; this.previewVisible = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment