-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07c9d21
commit 7337941
Showing
30 changed files
with
309 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script setup lang="ts"> | ||
import { onMounted, ref } from 'vue' | ||
import { makeDemoParams } from '../codeeditor' | ||
import Tooltip from './Tooltip.vue' | ||
import { Icon } from '@iconify/vue' | ||
const props = defineProps<{ | ||
name: string | ||
files: string[] | ||
}>() | ||
const sources = ref<Record<string, string>>({}) | ||
onMounted(() => { | ||
props.files?.forEach((file) => { | ||
const [folder, fileName] = file.split('/') | ||
const extension = file.split('.').pop() | ||
import(`../components/demo/${props.name}/${folder}/${fileName.replace(`.${extension}`, '')}.${extension}?raw`).then( | ||
res => (sources.value[fileName] = res.default), | ||
) | ||
}) | ||
}) | ||
function handleClick() { | ||
const url = makeDemoParams(props.name, 'nuxt') | ||
window.open | ||
? window.open(url, '_blank') | ||
: window.location.assign | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<Tooltip :content="`Open ${name} in Nuxt 3`"> | ||
<button @click="handleClick"> | ||
<Icon icon="simple-icons:nuxtdotjs" /> | ||
</button> | ||
</Tooltip> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script setup lang="ts"> | ||
import { onMounted, ref } from 'vue' | ||
import { makeDemoParams } from '../codeeditor' | ||
import Tooltip from './Tooltip.vue' | ||
import { Icon } from '@iconify/vue' | ||
const props = defineProps<{ | ||
name: string | ||
files: string[] | ||
}>() | ||
const sources = ref<Record<string, string>>({}) | ||
onMounted(() => { | ||
props.files?.forEach((file) => { | ||
const [folder, fileName] = file.split('/') | ||
const extension = file.split('.').pop() | ||
import(`../components/demo/${props.name}/${folder}/${fileName.replace(`.${extension}`, '')}.${extension}?raw`).then( | ||
res => (sources.value[fileName] = res.default), | ||
) | ||
}) | ||
}) | ||
function handleClick() { | ||
const url = makeDemoParams(props.name, 'storybook') | ||
window.open | ||
? window.open(url, '_blank') | ||
: window.location.assign | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<Tooltip :content="`Open ${name} in Storybook with Vue 3`"> | ||
<button @click="handleClick"> | ||
<Icon icon="simple-icons:storybook" /> | ||
</button> | ||
</Tooltip> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.