ui-style
页面开发样式规范。开发 UI 界面时使用
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
页面开发样式规范。开发 UI 界面时使用
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents.
tm-ui 组件 API 与源码定位。仅在需要核对某个 tm 组件的 props、events、slots、ref 方法或源码路径时使用;不要用于通用页面开发、样式规范或业务逻辑问题
移动端页面开发规范。开发 UI 界面时使用
创建新业务模块时使用
数据库建表规范。创建新表 SQL 时必须遵循;SQL 建完后必须继续阅读 table-config skill 来生成 {mod}.ts 配置
系统字典和业务字典配置。SQL 中有 dict: 或 dictbiz: 标注的字段时使用
| name | ui-style |
| description | 页面开发样式规范。开发 UI 界面时使用 |
| compatibility | Vue 3 + Element Plus + UnoCSS |
| metadata | {"version":"1.0"} |
$ref、$computed 等)ref, computed 等, 直接使用即可, 因为 vite.config.mts 配置了自动导入 AutoImport将冗长的 class 拆分为语义化属性:
<!-- ❌ 传统方式 -->
<el-button class="bg-blue-400 hover:bg-blue-500 py-2 px-4 box-border">
Button
</el-button>
<!-- ✅ Attributify -->
<el-button
un-bg="blue-400 hover:blue-500"
un-p="y-2 x-4"
un-box-border
>
Button
</el-button>
~当属性名与值相同时使用:
<!-- border border-red → un-border="~ red" -->
<el-button
un-border="~ red"
>
Button
</el-button>
<!-- flex flex-col → un-flex="~ col" -->
<div
un-flex="~ col"
></div>
无参数工具类直接作为属性:
<div
un-rounded
un-truncate
un-italic
></div>
把一组 class 改写成 Attributify 属性时, 按下面顺序逐条判断, 不需要一次套用所有规则:
text-sm text-white → un-text="sm white"~:flex flex-col → un-flex="~ col"rounded → un-roundedsolid 或颜色, 先用 0 清零未显式定义的其它边框方向:un-border="0 b-1 solid [#f0f2f5]", 不要写成 un-border="b-1 solid [#f0f2f5]"uno.config.ts 和 uno_uni.config.ts 中通过 UnoCSS presetIcons 注册了 iconfont collection,会自动读取 src/assets/iconfont/{icon_name}.svgun-i="iconfont-图标名" 挂在 view / text 等普通节点上,不要再写成 image + src,也不要用 new URL(...svg, import.meta.url) 去手动引资源un-text="[#f08b6a]"、un-w="5"、un-h="5"image 标签src/pages/product/Detail.vue 的收藏按钮写法<view
un-i="iconfont-favorite_service"
un-w="5"
un-h="5"
un-text="[#f08b6a]"
></view>
由 unplugin-auto-import 自动生成,无需手动维护。配置在 vite.config.mts 的 AutoImport({imports:[]}) 中
src/typings/auto-imports.d.ts 中的变量可直接使用:
// 如 dayjs、ref、computed 等
const now = dayjs().format('YYYY-MM-DD');
src/typings/components.d.ts 中的组件可直接在模板中使用:
<el-button>Click Me</el-button>
禁止在页面中内联 el-dialog,所有弹窗必须使用 CustomDialog 组件,抽离为独立的 XxxDialog.vue 文件。
XxxDialog.vue 放在同目录下showDialog() 返回 Promise,调用方 await 获取结果DialogAction 类型"auto" 自适应 / "medium" 中等 / "large" 大XxxDialog.vuetype DialogAction = "refund"; // 按业务定义
type OnCloseResolveType = {
type: "ok" | "cancel";
};
let onCloseResolve = function(_value: OnCloseResolveType) { };
const customDialogRef = $(useTemplateRef("customDialogRef"));
async function showDialog(arg: { action: DialogAction; row: XxxModel }) {
const dialogRes = customDialogRef!.showDialog<OnCloseResolveType>({
type: "auto",
title: "弹窗标题",
});
onCloseResolve = dialogRes.onCloseResolve;
return await dialogRes.dialogPrm;
}
function onClose() {
onCloseResolve({ type: "cancel" });
}
async function onConfirm() {
onCloseResolve({ type: "ok" });
}
defineExpose({ showDialog });
const xxxDialogRef = $(useTemplateRef("xxxDialogRef"));
const res = await xxxDialogRef!.showDialog({ action: "refund", row });
if (res.type === "ok") {
await dataGrid(true);
}
src/layout/change_password/ChangePassword.vue