-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] ssg/ssr not rendering correctly (#233)
* fix avatar rendering issue * add nuxt playground to demo ssr * fix requestAnimationFrame throwing error * fix element selected even though undefined * fix navigation menu not updating position for indicator correctly
- Loading branch information
Showing
47 changed files
with
10,443 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { onMounted, onUnmounted, ref } from "vue"; | ||
|
||
export type ImageLoadingStatus = "idle" | "loading" | "loaded" | "error"; | ||
|
||
export function useImageLoadingStatus(src?: string) { | ||
const loadingStatus = ref<ImageLoadingStatus>("idle"); | ||
const isMounted = ref(false); | ||
onMounted(() => { | ||
if (!src) { | ||
loadingStatus.value = "error"; | ||
return; | ||
} | ||
|
||
isMounted.value = true; | ||
const image = new window.Image(); | ||
|
||
const updateStatus = (status: ImageLoadingStatus) => () => { | ||
if (!isMounted.value) return; | ||
loadingStatus.value = status; | ||
}; | ||
|
||
loadingStatus.value = "loading"; | ||
image.onload = updateStatus("loaded"); | ||
image.onerror = updateStatus("error"); | ||
image.src = src; | ||
}); | ||
|
||
onUnmounted(() => { | ||
isMounted.value = false; | ||
}); | ||
|
||
return loadingStatus; | ||
} |
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,23 @@ | ||
# Nuxt dev/build outputs | ||
.output | ||
.nuxt | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
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,2 @@ | ||
shamefully-hoist=true | ||
strict-peer-dependencies=false |
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,63 @@ | ||
# Nuxt 3 Minimal Starter | ||
|
||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
```bash | ||
# npm | ||
npm install | ||
|
||
# pnpm | ||
pnpm install | ||
|
||
# yarn | ||
yarn install | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on `http://localhost:3000`: | ||
|
||
```bash | ||
# npm | ||
npm run dev | ||
|
||
# pnpm | ||
pnpm run dev | ||
|
||
# yarn | ||
yarn dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
```bash | ||
# npm | ||
npm run build | ||
|
||
# pnpm | ||
pnpm run build | ||
|
||
# yarn | ||
yarn build | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
# npm | ||
npm run preview | ||
|
||
# pnpm | ||
pnpm run preview | ||
|
||
# yarn | ||
yarn preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. |
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,101 @@ | ||
<script setup lang="ts"> | ||
import Card from "./components/Card.vue"; | ||
</script> | ||
|
||
<template> | ||
<div class="w-full flex flex-col items-center"> | ||
<div class="max-w-6xl w-full grid grid-cols-3 gap-4 pt-40 pb-40"> | ||
<Card> | ||
<AccordionDemo /> | ||
</Card> | ||
<Card> | ||
<AlertDialogDemo /> | ||
</Card> | ||
<Card> | ||
<AspectRatioDemo /> | ||
</Card> | ||
<Card> | ||
<AvatarDemo /> | ||
</Card> | ||
<Card> | ||
<CheckboxDemo /> | ||
</Card> | ||
<Card> | ||
<CollapsibleDemo /> | ||
</Card> | ||
<Card> | ||
<ScrollAreaDemo /> | ||
</Card> | ||
<Card class="col-span-2"> | ||
<ContextMenuDemo /> | ||
</Card> | ||
<Card class="col-span-2"> | ||
<DialogDemo /> | ||
</Card> | ||
<Card> | ||
<DropdownMenuDemo /> | ||
</Card> | ||
<Card> | ||
<MenubarDemo /> | ||
</Card> | ||
<Card class="col-span-2"> | ||
<NavigationMenuDemo /> | ||
</Card> | ||
<Card> | ||
<HoverCardDemo /> | ||
</Card> | ||
<Card> | ||
<LabelDemo /> | ||
</Card> | ||
<Card> | ||
<PopoverDemo /> | ||
</Card> | ||
<Card> | ||
<ProgressDemo /> | ||
</Card> | ||
<Card> | ||
<RadioGroupDemo /> | ||
</Card> | ||
<Card> | ||
<SelectDemo /> | ||
</Card> | ||
<Card> | ||
<SelectMultipleDemo /> | ||
</Card> | ||
<Card> | ||
<SeparatorDemo /> | ||
</Card> | ||
<Card> | ||
<SliderDemo /> | ||
</Card> | ||
<Card> | ||
<SwitchDemo /> | ||
</Card> | ||
<Card> | ||
<TabsDemo /> | ||
</Card> | ||
<Card> | ||
<ToggleDemo /> | ||
</Card> | ||
<Card> | ||
<ToggleGroupDemo /> | ||
</Card> | ||
<Card class="col-span-2"> | ||
<ToolbarDemo /> | ||
</Card> | ||
<Card> | ||
<TooltipDemo /> | ||
</Card> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
body { | ||
@apply bg-black text-white; | ||
} | ||
[data-radix-popper-content-wrapper] { | ||
@apply z-[1000]; | ||
} | ||
</style> |
Oops, something went wrong.