Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Nuxt #11

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<MyFirstStory />
</div>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
59 changes: 54 additions & 5 deletions components/MyFirstStory.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,59 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import MyNuxtLink from "./MyNuxtLink";
</script>

<template>
<div
class="shadow-lg text-white h-screen flex justify-center items-center text-2xl bg-black"
>
My First Story
<div class="bg-slate-700 shadow-lg text-white h-screen flex justify-center items-center text-2xl">
<ul>
<li>
<a href="https://github.com/Archetipo95">HTML link</a>
</li>
<li>
<NuxtLink to="/about"> About page </NuxtLink>
</li>
<li>
<NuxtLink v-slot="{ navigate }" to="/about" custom>
<button @click="navigate">Custom about page</button>
</NuxtLink>
</li>
<li>
<NuxtLink to="https://nuxtjs.org"> Nuxt website </NuxtLink>
</li>
<li>
<NuxtLink v-slot="{ href, target }" to="https://nuxtjs.org" custom>
<a :href="href" :target="target">Go to {{ href }}</a>
</NuxtLink>
</li>
<li>
<NuxtLink to="https://twitter.com/nuxt_js" target="_blank">
Nuxt Twitter with a blank target
</NuxtLink>
</li>
<li>
<NuxtLink to="https://discord.nuxtjs.org" target="_blank" rel="noopener">
Nuxt Discord with a blank target and custom rel value
</NuxtLink>
</li>
<li>
<NuxtLink to="https://github.com/nuxt" no-rel>
Nuxt GitHub without rel attribute
</NuxtLink>
</li>
<li>
<MyNuxtLink to="https://nuxtjs.org">
Nuxt website with a custom link component with no default rel
attribute
</MyNuxtLink>
</li>
<li>
<MyNuxtLink to="/">
Index page with a custom link component with a custom active class
</MyNuxtLink>
</li>
<li>
<NuxtLink>Link without href and to</NuxtLink>
</li>
</ul>
</div>
</template>

Expand Down
6 changes: 6 additions & 0 deletions components/MyNuxtLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default defineNuxtLink({
componentName: 'MyNuxtLink',
externalRelAttribute: '',
activeClass: 'active',
exactActiveClass: 'exact-active'
})
5 changes: 5 additions & 0 deletions pages/about.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script setup lang="ts"></script>

<template>
about page
</template>
6 changes: 6 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script setup lang="ts"></script>

<template>
homepage
<MyFirstStory />
</template>
14 changes: 7 additions & 7 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export default <Partial<Config>>{
"./nuxt.config.{js,ts}",
],
theme: {
colors:{
black: "#000",
white: "#fff",
red: "#f00",
green: "#0f0",
blue: "#00f",
},
extend: {
colors:{
black: "#000",
white: "#fff",
red: "#f00",
green: "#0f0",
blue: "#00f",
},
},
},
plugins: [],
Expand Down