- 博客(27)
- 收藏
- 关注
原创 CSS样式表width常忽略使用的fit-content/max-content/min-content属性值
宽度表示的并不是内部那个宽度小就是那个宽度. 而是,采用内部元素最小宽度值最大的那个元素的宽度作为最终容器的宽度。:简单理解就是假设我们的容器有足够的宽度,足够的空间 此时,所占据的宽度是就是。会采用内部元素的宽度值最大的元素作为容器的宽度。
2025-03-26 17:08:54
153
原创 andv table customRender设置成slots时候表格利用customCell合并列
andv table customRender设置成slots时候表格利用customCell合并列
2023-05-17 17:47:40
324
原创 json(tree pId)数据根据一个子节点递归查找所有父节点
// 查找一个节点的所有父节点(一棵树)// result:要查询的节点,treeData:json树形数据checkedKeysAll:找到数组集合 function relationParent(result: any, treeAData: any, checkedKeysAll: any) { const findParent = (childNode: any, treeData: any) => { for (let i = 0; i < t...
2022-03-17 10:01:53
692
原创 antdv table 数据操作升序、降序、删除、增加功能
let newData: any[] = [];1、升序 主要代码newData.filter((item, index) => { if (item.key == data.key) { newData[index] = newData.splice(index - 1, 1, newData[index])[0]; }});state.dataSource = newData;2、降序 主要代码(newData[index] = n...
2021-11-04 14:38:25
817
1
原创 antdv table二次封装(slots动态渲染的问题)
组件自己封装的an-table<n-table :loading="context.loading" :table-columns="pipeColumn" :table-data="context.dataSource" :scroll="{ y: 550 }" :rowClassName=" (record, index) => (index % 2 === 0 ? 'table-striped' : null) "&g
2021-10-20 16:15:37
1418
3
原创 树形结构的json 过滤某个节点是否在json中
// 组织机构数深度遍历获取某个机构是否在数据中0export function recursion(data: any, filterData: any) { let hasFound = false,// 表示是否有找到id值 result = null; const filter = (data: any) => { if (Array.isArray(data) && !hasFound) { // 判断是否.
2021-10-14 15:04:50
278
原创 andv table表格行点击添加选中状态背景变色
<a-table :size="state.tableSize" :loading="state.loading" :columns="dynamicColumns" :data-source="state.dataSource" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxPro.
2021-09-02 15:56:32
456
原创 vue-cli3 嵌入iframe 嵌入本地html 及数据交互
<iframe frameborder="0" ref="iframe" width="100%" height="100%" src="cron/paramconfig/toCron.html"></iframe>需要注意把cron 放在public下面且页面引入的时候直接cron/paramconfig/toCron.html 才能生效
2021-08-12 11:22:40
992
原创 vue-router 三级菜单多次加载(onmounted)
1、使用了<keep-alive></keep-alive>被包含在<keep-alive>中的组件,会多出两个生命周期钩子函数。 //被激活时执行=>onActivated() //比如从 A 组件,切换到 B 组件,A 组件消失时执行=>onDeactivated() 2、这时三级菜单就会多次onMounted解决办法:在三级里面嵌套vue里面导入onActivatedonActivated(()=>{..
2021-06-23 11:07:19
2150
原创 codemirror 提示方法自定义及方法参数添加背景色
html<sr-codemirror class="codemirror" :codemirror-Option="cmOption" :codemirror-Model="cmModel" @codemirrorChange="changeText" :codemirrorPlaceholder="'请输入'"></sr-codemirror>
2021-06-17 11:57:45
4109
原创 json 结构转成树结构
export function genTreeData(arr: []) { // 深拷贝一份数据 const level1 = JSON.parse(JSON.stringify(arr)); // 删除 所有 children,以防止多次调用 level1.forEach(function (item: ITreeItem) { delete item.children; }); // 将数据存储为 以 id 为 KEY 的 map .
2021-06-02 15:35:07
646
原创 帆软与dom交互 传出给外层, 外层接收方法
$('body').ready(setTimeout(function() {var arr =[];$(".ui-state-enabled").each(function() {arr.push($(this).outerHeight());});max = Math.max.apply(null,arr);alert("Fine"+arr);var msg = {height: max+'px'};window.parent.postMessage(msg, '*');}));
2021-05-28 11:30:58
236
原创 vue3 获取元素高度不准的方法
<transition name="slide-width"> <a-col class="fixed-small" v-show="isShow" :style="{height: `${ztreeHeight}px`}"> <div class="left-small"> <a-tree checkable :tree-data="menuTreeD.
2021-05-27 19:30:25
2758
原创 antdv table组件添加序号及序号补位‘0’
html:<template #indexDraw="{ text, record, index }"> {{ covering(index+1) }}</template>js:// table 设置列{ title: '序号', dataIndex: 'indexDraw', fixed: 'left', width: 50, slots: { customRender: 'indexDraw' },},
2021-05-24 15:29:53
1025
原创 antdv upload customRequest 前端上传方法
html:<a-upload v-model:file-list="fileList" list-type="picture-card" :before-upload="beforeUpload" @change="handleChange" :show-upload-list="false" :customRequest="customImageRequest"> <div class="upload-box" v-if="i.
2021-05-21 10:20:12
3556
原创 ant design vue 上传组件上传xls文件解析表格(a-table增加数据)
1、需要安装xlsx(npm install xlsx || yarn add xlsx)2、html<a-upload class="no-list" name="file" @change="exportData" :beforeUpload="beforeUploada"> <a-button type="primary">上传excel</a-button></a-upload>3、jsi
2021-05-07 15:09:58
1297
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人