首页龙虾技能列表 › PigX UI 前端开发 — 技能工具

PigX UI 前端开发 — 技能工具

v1.0.0

PigX UI Pro 前端开发指南 - Vue 3 + TypeScript + Element Plus。当用户提到 PigX UI、PigX 前端、lgb-mgui 项目、Vue 3 企业级后台开发、Element Plus 后台开发时使用此技能。

1· 118·0 当前·0 累计
by @zhibuyu (子不语)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/25
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
This is an instruction-only front-end development guide for PigX UI (Vue 3 + TypeScript + Element Plus); its content, requirements, and behavior are consistent with that purpose and it does not request credentials or install code.
评估建议
This skill is an offline developer guide and appears coherent with its stated purpose. It does not request credentials or install code. Before using it: (1) be cautious if the agent suggests running shell commands — inspect them and run them yourself in a trusted environment; (2) ignore the hard-coded local path if it doesn't match your system; (3) never paste tokens/secret keys into chat if the agent asks for them — this skill doesn't need them; (4) verify external links (e.g., docs.pig4cloud.c...
详细分析 ▾
用途与能力
Name and description match the SKILL.md and references: the files provide a PigX UI frontend development guide (commands, project layout, coding conventions). No unrelated binaries, credentials, or install steps are required.
指令范围
The SKILL.md is a local dev guide listing commands (pnpm dev/build/etc.), a Windows local project path (D:\WorkSpace\...), and implementation notes. It does not instruct the agent to read arbitrary system files, exfiltrate data, or call external endpoints beyond documented documentation URLs. The presence of a hard-coded local path is informational and could be ignored if it doesn't match the user's environment.
安装机制
No install specification and no code files that would be written to disk — this is instruction-only, which is the lowest-risk install profile.
凭证需求
The document references Authorization and TENANT-ID headers being 'auto-injected' in the app (i.e., how the frontend works), but the skill does not request any environment variables or credentials. Users should note that the guide discusses token usage conceptually; the skill itself does not ask for or store secrets.
持久化与权限
The skill is not 'always' enabled, is user-invocable, and does not request persistent agent privileges or modify other skill/system settings. Autonomous invocation is allowed by default but is not combined with other concerning privileges here.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/25

Initial release of pigxui-skill. - Vue 3 + TypeScript + Element Plus 前端开发指南 skill 发布 - 提供项目结构、开发命令、核心规范(API 路由/Pinia/组件/样式)、常见任务等说明 - 补充路径别名、自动导入、Token 与租户支持、请求加密等使用注意事项 - 包含官方与扩展文档链接

● 无害

安装命令 点击复制

官方npx clawhub@latest install pigxui-skill
镜像加速npx clawhub@latest install pigxui-skill --registry https://cn.clawhub-mirror.com

技能文档

PigX UI Pro 企业级前端开发指南 - Vue 3 + TypeScript + Element Plus

项目信息

属性
框架Vue 3 (Composition API)
语言TypeScript
UI 库Element Plus
状态管理Pinia
路由Vue Router
构建工具Vite
CSS 框架Tailwind CSS + DaisyUI
版本5.12.0

本地项目路径

D:\WorkSpace\my_workspace\lhb\lgb-mgui

官方文档

  • 文档入口: https://docs.pig4cloud.com(需要微信扫码登录)

常用命令

# 安装依赖
pnpm install

# 启动开发服务 (默认端口 8888) pnpm dev

# 生产构建 pnpm build

# Docker 构建 pnpm build:docker

# ESLint 检查修复 pnpm lint:eslint

# Prettier 格式化 pnpm prettier


项目结构

lgb-mgui/
├── src/
│   ├── api/              # API 请求定义
│   ├── assets/           # 静态资源
│   ├── components/       # 可复用组件(全局自动注册)
│   ├── directive/        # 自定义指令
│   ├── hooks/            # 组合式函数
│   ├── i18n/             # 国际化配置
│   ├── layout/           # 布局组件
│   ├── router/           # 路由配置(后端控制)
│   ├── stores/           # Pinia 状态管理
│   ├── theme/            # 主题样式
│   ├── types/            # TypeScript 类型定义
│   ├── utils/            # 工具函数
│   ├── views/            # 页面组件
│   ├── App.vue           # 根组件
│   └── main.ts           # 入口文件
├── public/               # 公共资源
├── vite.config.mts       # Vite 配置
├── tailwind.config.js    # Tailwind 配置
└── tsconfig.json         # TypeScript 配置

核心开发规范

1. API 调用规范

所有 API 必须放在 src/api/ 目录下:

// src/api/admin/audit.ts
import request from '/@/utils/request';

export function fetchList(query?: Object) { return request({ url: '/admin/audit/page', method: 'get', params: query, }); }

使用方式

const { data } = await fetchList(query);

自动处理的请求头

  • Authorization - Token 自动注入
  • TENANT-ID - 租户 ID 自动注入
  • 请求/响应加解密

2. 路由架构

  • 后端控制路由:路由由后端 API 返回,前端动态注入
  • 两级嵌套:路由最多支持两级嵌套(keep-alive 兼容)
  • 动态加载:使用 import.meta.glob 动态加载组件

3. 状态管理 (Pinia)

// src/stores/userInfo.ts
import { defineStore } from 'pinia';

export const useUserInfoStore = defineStore('userInfo', { state: () => ({ user: null, token: '', }), actions: { async login(credentials) { // ... }, }, persist: true, });

4. 组件规范

使用

5. 样式规范

Tailwind CSS

暗色模式

[data-theme='dark'] {
  // 暗色样式
}

常见开发任务

新增页面

  • src/views/ 下创建页面组件
  • 后端配置菜单和路由
  • src/api/ 中定义相关 API

新增 API 接口

// src/api/module/example.ts
import request from '/@/utils/request';

export function getList(params: any) { return request({ url: '/module/example/list', method: 'get', params, }); }

新增 Store

// src/stores/myStore.ts
import { defineStore } from 'pinia';

export const useMyStore = defineStore('myStore', { state: () => ({ items: [] }), getters: { itemCount: (state) => state.items.length, }, actions: { async fetchItems() {} }, persist: true, });


注意事项

  • 路径别名/@/ 指向 src/ 目录
  • 自动导入:Vue、Vue Router、Pinia API 自动导入
  • Token 管理:自动注入 Authorization
  • 租户支持:自动注入 TENANT-ID
  • 请求加密:默认开启,可通过 Enc-Flag: false 关闭

参考文档

  • Vue 3 文档: https://vuejs.org
  • Element Plus 文档: https://element-plus.org
  • Tailwind CSS 文档: https://tailwindcss.com

参考资料

更多前端文档请参考 references/ 目录下的文档文件。

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务