Skip to content

Commit

Permalink
test: add playground
Browse files Browse the repository at this point in the history
  • Loading branch information
aerophobic committed Aug 20, 2022
1 parent ca7a61c commit 638af5f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
6 changes: 6 additions & 0 deletions playground/components/ComponentA.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<div>
<h1>ComponentA</h1>
<slot />
</div>
</template>
6 changes: 6 additions & 0 deletions playground/components/ComponentB.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<div>
<h1>ComponentB</h1>
<slot />
</div>
</template>
16 changes: 16 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineNuxtConfig } from 'nuxt'
import BlokwiseDynamic from '..'

export default defineNuxtConfig({
typescript: {
shim: false
},

modules: [
BlokwiseDynamic
],

blokwisedynamic: {
withConsole: true
}
})
4 changes: 4 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"private": true,
"name": "@blokwise/dynamic-playground"
}
27 changes: 27 additions & 0 deletions playground/pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div>
<h1>index.vue</h1>
<NuxtDynamic
is-component="ComponentA"
:on="on"
/>

<NuxtDynamic
is-component="component-b"
:hydration="{ type: 'whenIdle' }"
@submit="onSubmit"
>
<span>passed through slot</span>
</NuxtDynamic>
</div>
</template>

<script setup>
const on = ref(['click'])
onMounted(() => {
setTimeout(() => {
on.value.push('mouseover')
}, 10000)
})
</script>

0 comments on commit 638af5f

Please sign in to comment.