Skip to content

Commit

Permalink
fix(preview): ensure async request render (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
larbish authored Jan 17, 2024
1 parent cd21104 commit 6132747
Show file tree
Hide file tree
Showing 7 changed files with 555 additions and 37 deletions.
10 changes: 3 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"extends": [
"@nuxt/eslint-config"
"@nuxtjs/eslint-config-typescript"
],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"import/named": "off",
"vue/multi-word-component-names": "off",
"func-call-spacing": "off",
"vue/no-v-model-argument": "off",
"import/order": "off"
"no-console": [2, { "allow": ["trace"] }],
"vue/multi-word-component-names": 0
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.9.1",
"@nuxt/ui-pro": "^0.6.1",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@types/node": "^20.10.7",
"changelogen": "^0.5.5",
"consola": "^3.2.3",
Expand Down
20 changes: 11 additions & 9 deletions playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ const { data: navigation } = useAsyncData('navigation', () => fetchContentNaviga
</script>

<template>
<UHeader
:title="appConfig.title"
:links="mapContentNavigation(navigation)"
/>
<UMain>
<UContainer>
<NuxtPage />
</UContainer>
</UMain>
<div>
<UHeader
:title="appConfig.title"
:links="mapContentNavigation(navigation)"
/>
<UMain>
<UContainer>
<NuxtPage />
</UContainer>
</UMain>
</div>
</template>
12 changes: 6 additions & 6 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ import { defineNuxtConfig } from 'nuxt/config'

export default defineNuxtConfig({
extends: '@nuxt/ui-pro',
modules: ['@nuxt/ui', '@nuxt/content', '../src/module', "@nuxt/image"],
modules: ['@nuxt/ui', '@nuxt/content', '../src/module', '@nuxt/image'],
studio: {
enabled: true,
project: 'studio/studio-module'
},
hooks: {
// Set all components to global
'components:extend': (components) => {
'components:extend': () => {
// components.forEach(component => {
// if (component.pascalName[0] === 'U') {
// component.global = true
// }
// })
},
'listen': async (_, { getURLs }) => {
listen: async (_, { getURLs }) => {
const urls = await getURLs()
const tunnelURL = urls.find(u => u.type === 'tunnel')
if (!tunnelURL) return consola.warn('Could not get Tunnel URL')
const tunnelURL = urls.find((u: { type: string }) => u.type === 'tunnel')
if (!tunnelURL) { return consola.warn('Could not get Tunnel URL') }
consola.box(
'Nuxt Studio Playground Ready.\n\n' +
'1. Go to https://nuxt.studio/@studio/studio-module\n' +
'2. Paste `'+tunnelURL.url+'` in the Deployed URL field\n' +
'2. Paste `' + tunnelURL.url + '` in the Deployed URL field\n' +
'3. Play with the Studio Playground!'
)
}
Expand Down
Loading

0 comments on commit 6132747

Please sign in to comment.