Skip to content

Commit

Permalink
fix(md-enhance): fix playground loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Sep 12, 2022
1 parent 8159d37 commit 3546010
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions packages/md-enhance/src/client/components/Playground.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent, h, ref } from "vue";
import { defineComponent, h } from "vue";

import { LOADING_SVG, PLAY_SVG } from "./icons.js";
import { PLAY_SVG } from "./icons.js";

import type { VNode } from "vue";

Expand All @@ -16,8 +16,6 @@ export default defineComponent({
},

setup(props) {
const loading = ref(true);

return (): (VNode | null)[] => [
h("div", { class: "playground-wrapper" }, [
h("div", { class: "title-wrapper" }, [
Expand All @@ -33,21 +31,14 @@ export default defineComponent({
}),
]),
]),
h("div", { class: "preview-container" }, [
loading.value
? h("div", {
class: ["preview-loading-wrapper"],
innerHTML: LOADING_SVG,
})
: null,
h(
"div",
{ class: "preview-container" },
h("iframe", {
class: "iframe-preview",
src: decodeURIComponent(props.link),
onload: () => {
loading.value = false;
},
}),
]),
})
),
]),
];
},
Expand Down

0 comments on commit 3546010

Please sign in to comment.