替换所有 simple-icons
This commit is contained in:
33
app/components/content/ColorModeSwitch.vue
Normal file
33
app/components/content/ColorModeSwitch.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<script setup>
|
||||
const colorMode = useColorMode()
|
||||
|
||||
const isLight = computed({
|
||||
get() {
|
||||
return colorMode.value === 'light'
|
||||
},
|
||||
set(_isLight) {
|
||||
colorMode.preference = _isLight ? 'light' : 'dark'
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ClientOnly>
|
||||
<div class="flex-1 flex items-center justify-center">
|
||||
<USwitch
|
||||
v-model="isLight"
|
||||
unchecked-icon="i-lucide-moon"
|
||||
checked-icon="i-lucide-sun"
|
||||
aria-label="Toggle color mode"
|
||||
size="xl"
|
||||
color="neutral"
|
||||
:ui="{
|
||||
base: 'w-70 h-35 rounded-lg rotate-90 data-[state=checked]:bg-[var(--ui-color-neutral-200)]',
|
||||
thumb: 'data-[state=checked]:translate-x-35 data-[state=checked]:rtl:-translate-x-35 rounded-lg size-34',
|
||||
icon: 'rotate-270 size-8',
|
||||
}"
|
||||
@click="isDark = !isDark"
|
||||
/>
|
||||
</div>
|
||||
</ClientOnly>
|
||||
</template>
|
24
app/components/content/Stack.vue
Normal file
24
app/components/content/Stack.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<UPageCard class="divide-y overflow-hidden rounded-xl [&:not(:first-child)]:mt-4 dark:divide-gray-700 shadow-sm ">
|
||||
<div
|
||||
v-for="(slot, i) in slotItems"
|
||||
:key="i"
|
||||
class=""
|
||||
>
|
||||
<component :is="slot" />
|
||||
</div>
|
||||
|
||||
</UPageCard>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const slots = useSlots()
|
||||
|
||||
// Process slots to create stack items
|
||||
const slotItems = computed(() => {
|
||||
const defaultSlots = slots.default?.() || []
|
||||
return defaultSlots.filter(slot => slot)
|
||||
})
|
||||
|
||||
defineSlots()
|
||||
</script>
|
@@ -6,6 +6,48 @@ navigation:
|
||||
---
|
||||
|
||||
|
||||
::::code-group
|
||||
|
||||
```bash [pnpm]
|
||||
pnpm add @nuxt/ui-pro@next
|
||||
```
|
||||
|
||||
```bash [yarn]
|
||||
yarn add @nuxt/ui-pro@next
|
||||
```
|
||||
|
||||
```bash [npm]
|
||||
npm install @nuxt/ui-pro@next
|
||||
```
|
||||
|
||||
```bash [bun]
|
||||
bun add @nuxt/ui-pro@next
|
||||
```
|
||||
::::
|
||||
|
||||
|
||||
|
||||
## Usage
|
||||
::note
|
||||
You can pass any property from the HTML `<img>` element such as `alt`, `loading`, etc.
|
||||
::
|
||||
|
||||
::stack
|
||||
::div{class="p-4 space-x-2"}
|
||||
:icon{name="lucide:box" class="size-6"}
|
||||
:icon{name="vscode-icons:file-type-js-official" class="size-6"}
|
||||
:icon{name="vscode-icons:file-type-vue" class="size-6"}
|
||||
:icon{name="vscode-icons:file-type-nuxt" class="size-6"}
|
||||
::
|
||||
|
||||
```mdc
|
||||
:icon{name="lucide:box"}
|
||||
:icon{name="vscode-icons:file-type-js-official"}
|
||||
:icon{name="vscode-icons:file-type-vue"}
|
||||
:icon{name="vscode-icons:file-type-nuxt" :size="30"}
|
||||
```
|
||||
::
|
||||
|
||||
::ETabs
|
||||
::div{label="PostgreSQL" icon="lucide:database"}
|
||||
### PostgreSQL column types
|
||||
|
@@ -5,6 +5,207 @@ navigation:
|
||||
icon: lucide-download
|
||||
---
|
||||
|
||||
|
||||
::ProseImg{src="https://lijue-me.oss-cn-chengdu.aliyuncs.com/20250727184358217.png"}
|
||||
::
|
||||
|
||||
::stack
|
||||
::div{class="p-6 text-3xl font-bold"}
|
||||
✨ shadcn-docs-nuxt
|
||||
::
|
||||
|
||||
```mdc
|
||||
---
|
||||
title: Installation
|
||||
description: How to install shadcn-docs-nuxt in your app.
|
||||
icon: lucide:play
|
||||
---
|
||||
|
||||
## Using the starter template
|
||||
```
|
||||
|
||||
|
||||
:read-more{title="Installation" to="/getting-started/installation"}
|
||||
|
||||
::card
|
||||
---
|
||||
title: Components
|
||||
icon: lucide:box
|
||||
---
|
||||
See MDC components provided by **shadcn-docs-nuxt**.
|
||||
::
|
||||
::
|
||||
|
||||
::field-group
|
||||
::field{name="withDefault" type="boolean" defaultValue="true"}
|
||||
A field with a default value.
|
||||
::
|
||||
::field{name="requiredField" type="boolean" required}
|
||||
A required field.
|
||||
::
|
||||
::field{name="clear (path?: string)" type="void"}
|
||||
Clears form errors associated with a specific path. If no path is provided, clears all form errors.
|
||||
::
|
||||
::field{name="getErrors (path?: string)" type="FormError[]"}
|
||||
Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.
|
||||
::
|
||||
::field{name="setErrors (errors: FormError[], path?: string)" type="void"}
|
||||
Sets form errors for a given path. If no path is provided, overrides all errors.
|
||||
::
|
||||
::field{name="errors" type="Ref<FormError[]>"}
|
||||
A reference to the array containing validation errors. Use this to access or manipulate the error information.
|
||||
::
|
||||
::
|
||||
::code-tree{defaultValue="nuxt.config.ts"}
|
||||
|
||||
```css [app/assets/main.css]
|
||||
@import "tailwindcss" theme(static);
|
||||
@import "@nuxt/ui-pro";
|
||||
```
|
||||
|
||||
```ts [app/app.config.ts]
|
||||
export default defineAppConfig({
|
||||
ui: {
|
||||
colors: {
|
||||
primary: 'sky',
|
||||
colors: 'slate'
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
```vue [app/app.vue]
|
||||
<template>
|
||||
<UApp>
|
||||
<NuxtPage />
|
||||
</UApp>
|
||||
</template>
|
||||
```
|
||||
|
||||
```json [package.json]
|
||||
{
|
||||
"name": "nuxt-app",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare",
|
||||
"typecheck": "nuxt typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify-json/lucide": "^1.2.18",
|
||||
"@nuxt/ui-pro": "3.0.0-alpha.10",
|
||||
"nuxt": "^3.15.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.2",
|
||||
"vue-tsc": "^2.2.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```json [tsconfig.json]
|
||||
{
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
```
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export default defineNuxtConfig({
|
||||
modules: ['@nuxt/ui-pro'],
|
||||
|
||||
future: {
|
||||
compatibilityVersion: 4
|
||||
},
|
||||
|
||||
css: ['~/assets/main.css']
|
||||
});
|
||||
```
|
||||
|
||||
````md [README.md]
|
||||
# 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
|
||||
|
||||
# bun
|
||||
bun install
|
||||
```
|
||||
|
||||
## Development Server
|
||||
|
||||
Start the development server on `http://localhost:3000`:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm run dev
|
||||
|
||||
# yarn
|
||||
yarn dev
|
||||
|
||||
# bun
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Production
|
||||
|
||||
Build the application for production:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm run build
|
||||
|
||||
# yarn
|
||||
yarn build
|
||||
|
||||
# bun
|
||||
bun run build
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run preview
|
||||
|
||||
# pnpm
|
||||
pnpm run preview
|
||||
|
||||
# yarn
|
||||
yarn preview
|
||||
|
||||
# bun
|
||||
bun run preview
|
||||
```
|
||||
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
````
|
||||
|
||||
::
|
||||
|
||||
|
||||
::tip{target="_blank" to="https://content.nuxt.com/templates/docs"}
|
||||
Use this template on Nuxt Studio and start your documentation in seconds.
|
||||
::
|
||||
|
@@ -20,7 +20,8 @@
|
||||
"better-sqlite3": "^12.2.0",
|
||||
"nuxt": "^4.0.1",
|
||||
"nuxt-llms": "0.1.3",
|
||||
"nuxt-og-image": "^5.1.9"
|
||||
"nuxt-og-image": "^5.1.9",
|
||||
"{collection_name}": "link:@iconify-json/{collection_name}"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/lucide": "^1.2.57",
|
||||
@@ -28,6 +29,7 @@
|
||||
"@nuxt/eslint": "^1.5.2",
|
||||
"@vueuse/core": "^13.5.0",
|
||||
"eslint": "^9.31.0",
|
||||
"lucide": "^0.526.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vue": "^3.5.17",
|
||||
"vue-tsc": "^3.0.1"
|
||||
|
33
patch-ui-pro.zsh
Executable file
33
patch-ui-pro.zsh
Executable file
@@ -0,0 +1,33 @@
|
||||
# 绕过 UI Pro 的 License 验证
|
||||
set -euo pipefail
|
||||
|
||||
# 1. 禁用 module.mjs 的调用
|
||||
MODULE="node_modules/@nuxt/ui-pro/dist/module.mjs"
|
||||
if [[ -f $MODULE ]]; then
|
||||
sed -i.bak '/await validateLicense({.*rootDir })/s/^/\/\//; /^await validateLicense({.*rootDir })/s/^/\/\//' "$MODULE"
|
||||
rm -f "$MODULE.bak"
|
||||
echo "✅ module.mjs 已屏蔽"
|
||||
fi
|
||||
|
||||
# 2. 直接“替换函数” fake 200
|
||||
SHARED="node_modules/@nuxt/ui-pro/dist/shared"
|
||||
JS=$(find "$SHARED" -maxdepth 1 -name 'ui-pro.*.mjs' | head -n1)
|
||||
[[ -z $JS || ! -f $JS ]] && { echo "⚠️ ui-pro.*.mjs 未找到"; exit 0; }
|
||||
|
||||
cat <<'EOF' > tmp_func.mjs
|
||||
async function validateLicense(opts) {
|
||||
/* --- patched --- */
|
||||
return { status: 200 }
|
||||
}
|
||||
EOF
|
||||
|
||||
sed -i.bak '/^async function validateLicense[^(]*(/,/^\}$/c\
|
||||
async function validateLicense(opts) {\
|
||||
/* --- patched --- */\
|
||||
return { status: 200 }\
|
||||
}\
|
||||
' "$JS"
|
||||
rm -f "$JS.bak" tmp_func.mjs
|
||||
|
||||
echo "✅ $JS 已 mock 完成"
|
||||
echo "🎉 License ⛔ Done!"
|
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
@@ -38,6 +38,9 @@ importers:
|
||||
nuxt-og-image:
|
||||
specifier: ^5.1.9
|
||||
version: 5.1.9(@unhead/vue@2.0.12(vue@3.5.17(typescript@5.8.3)))(magicast@0.3.5)(unstorage@1.16.1(@netlify/blobs@9.1.2)(db0@0.3.2(better-sqlite3@12.2.0))(ioredis@5.6.1))(vite@7.0.6(@types/node@24.0.7)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))(vue@3.5.17(typescript@5.8.3))
|
||||
'{collection_name}':
|
||||
specifier: link:@iconify-json/{collection_name}
|
||||
version: link:@iconify-json/{collection_name}
|
||||
devDependencies:
|
||||
'@iconify-json/lucide':
|
||||
specifier: ^1.2.57
|
||||
@@ -54,6 +57,9 @@ importers:
|
||||
eslint:
|
||||
specifier: ^9.31.0
|
||||
version: 9.31.0(jiti@2.4.2)
|
||||
lucide:
|
||||
specifier: ^0.526.0
|
||||
version: 0.526.0
|
||||
typescript:
|
||||
specifier: ^5.8.3
|
||||
version: 5.8.3
|
||||
@@ -4331,6 +4337,9 @@ packages:
|
||||
lru-cache@5.1.1:
|
||||
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
||||
|
||||
lucide@0.526.0:
|
||||
resolution: {integrity: sha512-qcefehq2iyryHABeJNDRPxHRtdzWYxB0XVyWnxNjpmO9FtTupLBBc0Q3PFHGyjlmZUxDWr4q1nNepBIkjHeIbA==}
|
||||
|
||||
luxon@3.6.1:
|
||||
resolution: {integrity: sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -11058,6 +11067,8 @@ snapshots:
|
||||
dependencies:
|
||||
yallist: 3.1.1
|
||||
|
||||
lucide@0.526.0: {}
|
||||
|
||||
luxon@3.6.1: {}
|
||||
|
||||
magic-regexp@0.10.0:
|
||||
|
Reference in New Issue
Block a user