import{_ as i,o as a,c as t,a2 as h}from"./chunks/framework.B-QBKwc1.js";const o=JSON.parse('{"title":"前端组件速查","description":"以下组件定义在 ui/src/components/ 目录下,可在页面中直接引入使用。","frontmatter":{},"headers":[],"relativePath":"zh/appendix/components.md","filePath":"zh/appendix/components.md"}'),n={name:"zh/appendix/components.md"};function k(l,s,e,p,d,r){return a(),t("div",null,[...s[0]||(s[0]=[h(`
G. 前端组件速查 概述
以下组件定义在 ui/src/components/ 目录下,可在页面中直接引入使用。
数据展示 组件 路径 说明 核心 Props BasicTable components/Table/数据表格 columns、dataSource、paginationPageWrapper components/Page/页面容器 title、contentFullHeightCountTo components/CountTo/数字动画 startVal、endVal、durationQrcode components/Qrcode/二维码 value、size、levelIcon components/icon/图标选择器 value、disabled
数据录入 组件 路径 说明 核心 Props BasicForm components/Form/动态表单 schemas、labelWidthBasicModal components/Modal/弹窗 title、width、okTextBasicUpload components/Upload/文件上传 action、maxCount、acceptEditor components/Editor/富文本编辑器 value、height、placeholderPassword components/Password/密码强度 value、placeholderChinaArea components/ChinaArea/省市区联动 value、placeholderRegion components/Region/行政区划 value、levelCropper components/Cropper/头像裁剪 image、aspectRatioNumberInput components/numberInput/数字输入 value、min、maxPriceInput components/priceInput/价格输入 value、precision
Excel 组件 路径 说明 ImportExcel components/Excel/Excel 导入(解析文件) Export2Excel components/Excel/Excel 导出(生成文件)
其他 组件 路径 说明 Authority components/Authority/权限组件(根据权限显示/隐藏) CheckToken components/CheckToken/Token 校验组件 Lockscreen components/Lockscreen/锁屏组件 Websocket components/Websocket/WebSocket 组件
使用示例 BasicTable vue < template >
< BasicTable
:columns = " columns "
:request = " loadDataTable "
:row-key = " (row) => row.id "
ref = " basicTableRef "
/>
</ template >
< script setup >
import { BasicTable } from ' @/components/Table ' ;
import { getExamplePage } from ' @/api/tool/example ' ;
const columns = [
{ title : ' ID ' , key : ' id ' , width : 80 },
{ title : ' 名称 ' , key : ' name ' },
{ title : ' 状态 ' , key : ' statusText ' , width : 100 },
];
const loadDataTable = async ( params ) => await getExamplePage ({ ... params });
</ script > vue < template >
< BasicForm @register = " registerForm " />
</ template >
< script setup >
import { BasicForm , useForm } from ' @/components/Form ' ;
const [ registerForm ] = useForm ({
schemas : [
{ field : ' name ' , label : ' 名称 ' , component : ' NInput ' , required : true },
{ field : ' status ' , label : ' 状态 ' , component : ' NSelect ' , componentProps : { options : [ ... ] } },
],
});
</ script > BasicModal vue < template >
< BasicModal @register = " registerModal " @ok = " handleSubmit " />
</ template >
< script setup >
import { BasicModal , useModal } from ' @/components/Modal ' ;
const [ registerModal , { openModal , closeModal }] = useModal ();
const handleAdd = () => openModal ( true , { isUpdate : false });
const handleSubmit = async () => { /* ... */ closeModal (); };
</ script > `,17)])])}const c=i(n,[["render",k]]);export{o as __pageData,c as default};