Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
drag-tree-table-yk
Advanced tools
IE10+/Chrome/firefox
2.0.8
及以上版本基于vue实现的可以拖拽排序的树形表格
支持拖拽排序、固定头、拖拽改变行宽,checkbox多选、自定义单元格内容、设置行的背景色、动态控制某些行是否可以拖拽等等....
npm
npm i drag-tree-table-yk --save-dev
script
<script src="./dist/dtree-table.js"></script>
我用的是iconfont阿里的图标库里面有些字体你的电脑没有可能 直接link引入//at.alicdn.com/t/font_1472101_svwr4uiuqh.css
<template>
<div id="app">
<dragTreeTable
:data="treeData"
:onDrag="onTreeDataChange"
fixed
border>
</dragTreeTable>
</div>
</template>
<script>
import dragTreeTable from "drag-tree-table";
export default {
name: "app",
data() {
return {
treeData: {
columns: [...],
lists: [...]
}
};
},
components: {
dragTreeTable
},
mounted() {
var columns = [
{
type: "icon",
// title: "<a>菜单名称</a>",
field: "name",
width: 250,
// align: "left",
// titleAlign: "left",
formatter: item => {
return "<span>" + item.name + "</span>";
},
totalNum:'id', //新增了两个节点这个id可以随意放置你的参数名然后纯展示动态数据用
isDragOpen:'isOpen', //新增isOpen需要你在data中中加一个属性,然后只通过这个节点来控制拖动,另外我用的是iconfont阿里的图标库里面有些字体你的电脑没有可能 直接link引入//at.alicdn.com/t/font_1472101_svwr4uiuqh.css
actions1:[{
text: "编辑",
onclick: this.onTreeDataChange,
formatter: item => {
return "<span>编辑</span>";
}
// onclick: this.onDetail,
},{
text: "排序",
onclick: this.onTreeDataChange,
formatter: item => {
return "<span>排序</span>";
}
// onclick: this.onDetail,
},{
text: "删除",
onclick: this.onTreeDataChange,
formatter: item => {
return "<span>删除</span>";
}
// onclick: this.onDetail,
}]
},
]
},
methods: {
onTreeDataChange(list) {
this.treeData.lists = list;
}
},
};
</script>
更多组件详细功能请参考 API文档
cold_daywx
,欢迎沟通(找我加新需求的记得先来个star支持下哦)FAQs
基于Vue实现可以拖拽排序的树形表格
The npm package drag-tree-table-yk receives a total of 0 weekly downloads. As such, drag-tree-table-yk popularity was classified as not popular.
We found that drag-tree-table-yk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.