lint fix
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -4,22 +4,28 @@ FROM node:20-alpine AS base
|
||||
# 1. 如项目有原生包(better-sqlite3、sharp等)启用下面两行
|
||||
# RUN apk add --no-cache build-base python3 sqlite-dev
|
||||
|
||||
# 安装pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 2. 用 npm 锁文件
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev # devDependencies 会用于编译阶段,保留即可
|
||||
# 2. 用 pnpm 锁文件
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# 3. 源码 + 打补丁
|
||||
COPY . .
|
||||
RUN chmod +x patch-ui-pro.zsh && ./patch-ui-pro.zsh
|
||||
|
||||
# 4. 构建产物
|
||||
RUN npm run build
|
||||
RUN pnpm build
|
||||
|
||||
########## 阶段 2:生产运行时 ##########
|
||||
FROM node:20-alpine AS production
|
||||
|
||||
# 安装pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# 输出里有 .output,Nuxt3 的默认路径
|
||||
WORKDIR /app
|
||||
|
||||
@@ -27,8 +33,8 @@ WORKDIR /app
|
||||
# RUN apk add --no-cache sqlite-libs
|
||||
|
||||
# 2. 只拷贝生产运行时
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev --only=production
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
|
||||
COPY --from=base /app/.output /app/.output
|
||||
|
||||
|
@@ -7,7 +7,7 @@ const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSe
|
||||
})
|
||||
|
||||
// 获取主题系统
|
||||
const { selectedTheme, selectedFont, selectedFontSize } = useTheme()
|
||||
const { selectedTheme, selectedFont } = useTheme()
|
||||
|
||||
// 计算根元素的 CSS 类
|
||||
const rootClasses = computed(() => {
|
||||
@@ -50,7 +50,6 @@ provide('navigation', navigation)
|
||||
<template>
|
||||
<UApp>
|
||||
<NuxtLoadingIndicator />
|
||||
|
||||
<UMain>
|
||||
<NuxtLayout>
|
||||
<NuxtPage />
|
||||
|
@@ -96,14 +96,6 @@ const getChildrenWithIcons = (item: ContentNavigationItem) => {
|
||||
return item.children.filter(child => child.title)
|
||||
}
|
||||
|
||||
// 获取描述信息
|
||||
const getDescription = (item: ContentNavigationItem) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
return `${item.children.length} 个子页面`
|
||||
}
|
||||
return '文档页面'
|
||||
}
|
||||
|
||||
// 导航方法
|
||||
const navigateTo = (path: string) => {
|
||||
if (path) {
|
||||
|
@@ -7,6 +7,7 @@
|
||||
>
|
||||
<template
|
||||
v-for="item in tabItems"
|
||||
:key="item.slot"
|
||||
#[item.slot]="{ item: slotItem }"
|
||||
>
|
||||
<div class="mt-4">
|
||||
@@ -21,7 +22,7 @@ import type { TabsItem } from '@nuxt/ui'
|
||||
|
||||
const slots = useSlots()
|
||||
|
||||
const slotContents = ref<Record<string, any>>({})
|
||||
const slotContents = ref<Record<string, unknown>>({})
|
||||
|
||||
const tabItems = computed(() => {
|
||||
const defaultSlots = slots.default?.() || []
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { NavigationMenuItem } from '@nuxt/ui'
|
||||
|
||||
const route = useRoute()
|
||||
const items = ref<NavigationMenuItem[][]>([
|
||||
[
|
||||
{
|
||||
|
@@ -35,8 +35,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const isSidebarOpen = ref(false)
|
||||
|
||||
|
@@ -18,6 +18,8 @@ useSeoMeta({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<IndexHero />
|
||||
<IndexCard />
|
||||
<div>
|
||||
<IndexHero />
|
||||
<IndexCard />
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user