bnason
bnason
Explore posts from servers
NNuxt
Created by bnason on 12/10/2024 in #❓・help
NuxtPage default page
@kapa.ai I ended up using <template v-if="$route.name === 'parent'"> instead of relying on a slug
19 replies
NNuxt
Created by bnason on 12/10/2024 in #❓・help
NuxtPage default page
@kapa.ai that uses an index.vue which I don't want to have to create
19 replies
NNuxt
Created by bnason on 12/10/2024 in #❓・help
NuxtPage default page
@kapa.ai I do not want the default page to also be rendered with the child page
19 replies
NNuxt
Created by bnason on 12/9/2024 in #❓・help
`#shared` types. Failed to resolve extends base type.
I CAN however do import type { BudgetItem } from '#build/imports'
10 replies
NNuxt
Created by bnason on 12/9/2024 in #❓・help
`#shared` types. Failed to resolve extends base type.
If I try that in my script setup, I get Cannot find module '#shared' or its corresponding type declarations.
10 replies
NNuxt
Created by bnason on 12/9/2024 in #❓・help
`#shared` types. Failed to resolve extends base type.
10 replies
NNuxt
Created by bnason on 12/9/2024 in #❓・help
`#shared` types. Failed to resolve extends base type.
10 replies
NNuxt
Created by bnason on 12/9/2024 in #❓・help
`#shared` types. Failed to resolve extends base type.
I'm trying to use the shared types for my component props, for example: This is my ./shared/types/Budget.ts
export interface BudgetItem {
name: string
available: number
}

export interface BudgetCategory {
name: string
items: BudgetItem[]
}

export interface Budget {
name: string
categories: BudgetCategory[]
}
export interface BudgetItem {
name: string
available: number
}

export interface BudgetCategory {
name: string
items: BudgetItem[]
}

export interface Budget {
name: string
categories: BudgetCategory[]
}
This is my ./app/components/Budget/Item.vue
<script setup lang="ts">
interface Props extends BudgetItem {}

defineProps<Props>()
</script>

<template>
<div>
<div>{{ name }}</div>
<div>{{ available }}</div>
</div>
</template>
<script setup lang="ts">
interface Props extends BudgetItem {}

defineProps<Props>()
</script>

<template>
<div>
<div>{{ name }}</div>
<div>{{ available }}</div>
</div>
</template>
10 replies
NNuxt
Created by bnason on 12/8/2024 in #❓・help
NuxtLink active boolean
@kapa.ai Looks like this works <NuxtLink to="/settings" v-slot="{ isActive }"><MyCustomButton :selected="isActive" /></NuxtLink>
13 replies
NNuxt
Created by bnason on 12/8/2024 in #❓・help
NuxtLink active boolean
@kapa.ai I don't use Nuxt UI
13 replies
NNuxt
Created by bnason on 12/4/2024 in #❓・help
Auto import utils in server recursively
@kapa.ai I don't want this in a module, I want it for my main application.
10 replies
NNuxt
Created by bnason on 11/1/2024 in #❓・help
Nuxt Devtools not working
Hmm I think it has to do with @vite-pwa/nuxt
7 replies
NNuxt
Created by bnason on 11/1/2024 in #❓・help
Nuxt Devtools not working
That did not resolve the isssue
7 replies
CDCloudflare Developers
Created by bnason on 10/22/2024 in #general-help
Serve url on any subdomain
I think the Origin Rule I setup is working. I have to modify my app to add a base tag in the head so that all my scripts/images are properly loaded however. All that could be done in a worker/snippet but this seems to be the easier option for now.
9 replies
NNuxt
Created by bnason on 10/23/2024 in #❓・help
Reference assets with domain name
This is what I came up with: ~~/server/plugins/meta-base.ts
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('render:html', (html, { event }) => {
html.head.unshift(`<base href="https://foo.example.com/" />`)
})
})
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('render:html', (html, { event }) => {
html.head.unshift(`<base href="https://foo.example.com/" />`)
})
})
6 replies
CDCloudflare Developers
Created by bnason on 10/22/2024 in #general-help
Serve url on any subdomain
Not yet. I tihink I could also accomplish this via Workers AND snippets? Is there any benefit either way?
9 replies
CDCloudflare Developers
Created by bnason on 10/22/2024 in #general-help
Serve url on any subdomain
The only thing in front of them all is CloudFlare
9 replies
CDCloudflare Developers
Created by bnason on 10/22/2024 in #general-help
Serve url on any subdomain
We do not have a single load balancer in front of all the subdomains. Some are hosted internally while some are hosted by our software vendoer and we don't have any control over their lbs
9 replies
CDCloudflare Developers
Created by bnason on 10/22/2024 in #general-help
Serve url on any subdomain
Would that be an Origin Rule? With expression of(starts_with(http.request.uri.path, "/__debug")) and then Host Header Rewrite, SNI Rewrite, and DNS Record Override pointing to foo.example.com?
9 replies
NNuxt
Created by bnason on 10/16/2024 in #❓・help
Shared types/utils
So far, I've gotten this so far which works for everything except types in *.d.ts files
nitro: {
imports: {
dirs: ['./shared/types', './shared/utils'],
},
},
imports: {
dirs: ['../shared/types/**', '../shared/utils/**'],
},
nitro: {
imports: {
dirs: ['./shared/types', './shared/utils'],
},
},
imports: {
dirs: ['../shared/types/**', '../shared/utils/**'],
},
2 replies