Skip to content

Commit

Permalink
perf: crossOriginPrefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Apr 7, 2023
1 parent 67713e7 commit 7ef3669
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/content/block-course.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const { data } = useAsyncData(`/config/course`, () => {

<template>
<div class="grid gap-5 grid-cols-1 !px-8" lg="grid-cols-4" md="grid-cols-3" sm="grid-cols-2 px-0">
<NuxtLink v-for="v of data?.course" :key="v.href" :to="v.href" target="__blank">
<NuxtLink v-for="v of data?.course" :key="v.href" :to="v.href">
<article hover="shadow-md" dark="shadow-gray-900" dark:hover="shadow-gray-500/50"
class="overflow-hidden rounded-lg cursor-pointer shadow transition-shadow">
<div>
Expand Down
2 changes: 1 addition & 1 deletion components/content/block-open.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function filterIcons(icons?: string[]) {
v-for="v of data?.open"
:key="v.href"
:to="v.href"
target="__blank">
>
<div
hover="shadow-md"
dark="shadow-gray-900"
Expand Down
2 changes: 1 addition & 1 deletion components/content/card-link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineProps<{
<Icon name="teenyicons:documents-outline" size="16px"></Icon>
<span> 文档 </span>
</NuxtLink>
<NuxtLink v-if="video" :to="video" target="__blank"
<NuxtLink v-if="video" :to="video"
class="flex items-center space-x-1 cursor-pointer hover:text-cyan-600">
<Icon name="ic:outline-video-library" size="20px"></Icon>

Expand Down
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export default defineNuxtConfig({
},
experimental: {
asyncEntry: true, // 异步入口
payloadExtraction: false // 禁止 payload 提取
payloadExtraction: false, // 禁止 payload 提取
crossOriginPrefetch: true, // 跨域预取,加快外链的速度
},
vite: {
define: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"release": "bumpp --commit --push --tag"
},
"devDependencies": {
"@arco-design/web-vue": "^2.44.7",
"@arco-design/web-vue": "^2.45.0",
"@nuxt-themes/docus": "^1.10.1",
"@nuxt/devtools": "^0.3.1",
"@nuxt/image-edge": "1.0.0-28008586.381b906",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7ef3669

Please sign in to comment.