Skip to content

Commit

Permalink
docs: remove unnecessary files and add basic demo
Browse files Browse the repository at this point in the history
Removed the unused file `docs/guide/demo/aaa.vue` and added a basic demo in `docs/guide/demo/basic.vue` that displays a "Hello World" text using `vue3-pixi`'s `Application` and `text` components.
  • Loading branch information
Mr.Mao committed Jun 3, 2023
1 parent 31b5729 commit 6c9fa3f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions docs/.vitepress/theme/components/PixiJSContainer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const message = useMessage()
const containerRef = ref<HTMLElement>()
const showHighlighted = ref(props.expand)
const isUsingTs = ref(true)
const isUsingTs = ref(!!props.sfcTsCode)
const sfcTsCode = computed(() => decodeURIComponent(props.sfcTsCode))
const sfcJsCode = computed(() => decodeURIComponent(props.sfcJsCode))
Expand All @@ -50,7 +50,7 @@ async function onCopyCode() {
<Card>
<template #header>
<div class="flex gap-2">
<div class="cursor-pointer i-akar-icons-typescript-fill p-10px" :class="[isUsingTs && 'text-[#007acc]']" @click="isUsingTs = true" />
<div v-if="sfcTsCode" class="cursor-pointer i-akar-icons-typescript-fill p-10px" :class="[isUsingTs && 'text-[#007acc]']" @click="isUsingTs = true" />
<div class="cursor-pointer i-akar-icons-javascript-fill p-10px" :class="[!isUsingTs && 'text-amber']" @click="isUsingTs = false" />
</div>
<div class="flex gap-2">
Expand All @@ -67,8 +67,8 @@ async function onCopyCode() {
/>
</div>
</template>
<div ref="containerRef" class="flex justify-center">
<Application v-if="app" :width="688" :height="300">
<div ref="containerRef" class="flex justify-center bg-black min-h-300px">
<Application v-if="app" :width="300" :height="300">
<slot />
</Application>
<template v-else>
Expand Down
8 changes: 0 additions & 8 deletions docs/guide/demo/aaa.vue

This file was deleted.

11 changes: 11 additions & 0 deletions docs/guide/demo/basic.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup>
import { Application } from 'vue3-pixi'
</script>

<template>
<Application :width="300" :height="300">
<text :anchor="0.5" :x="150" :y="150" :style="{ fill: 'white' }">
Hello World
</text>
</Application>
</template>
5 changes: 0 additions & 5 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
# adwa

## bwawa

<demo src="./demo/aaa.vue" />

0 comments on commit 6c9fa3f

Please sign in to comment.