Skip to content

Commit

Permalink
Live demo (#42)
Browse files Browse the repository at this point in the history
* feat: add progress in vue playground

* feat: add 600 delay
  • Loading branch information
meloalright authored Aug 17, 2024
1 parent a53a28f commit 528631f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions vue-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"prismjs": "^1.29.0",
"vue": "^3.2.13",
"vue-live": "^2.5.4",
"vue3-progress": "0.0.1-beta4",
"vue-skia": "workspace:*"
},
"devDependencies": {
Expand Down
9 changes: 8 additions & 1 deletion vue-playground/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<vue3-progress />
<main v-if="!loading" style="text-align: center">
<template v-if="true">
<h1>Vue Skia</h1>
Expand All @@ -19,6 +20,7 @@
</div>
<VueLive
:editorProps="{ lineNumbers: true }"
:delay="600"
:code="!loading && !debug ? code : LoadingCode"
:layout="CustomLayout"
:components="{
Expand Down Expand Up @@ -113,6 +115,7 @@ import code from "./code";
import LoadingCode from "./loading-code";
import "vue-live/style.css";
import "prism-themes/themes/prism-night-owl.css";
export default defineComponent({
name: "App",
components: {
Expand Down Expand Up @@ -159,11 +162,15 @@ export default defineComponent({
}
this.loading = false;
(this as unknown as { $progress: { start: () => void; finish: () => void } }).$progress.finish();
});
},
created() {
(this as unknown as { $progress: { start: () => void; finish: () => void } }).$progress.start();
},
methods: {
input(event: any) {
this.code = event.target._value;
// this.code = event.target._value;
},
copy() {
try {
Expand Down
5 changes: 5 additions & 0 deletions vue-playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { createApp } from "vue";
import App from "./App.vue";
import { VueSkia } from 'vue-skia'
import Vue3Progress from "vue3-progress";

const app = createApp(App);
app.use(VueSkia);
app.use(Vue3Progress, {
position: "fixed",
color: "rgb(0, 161, 132)",
})
app.mount("#app");

0 comments on commit 528631f

Please sign in to comment.