VUE tree树双击选中(显示层级结构) 及 vuedraggable插件拖拽功能的实现_el-tree树节点双击

HTTP

  • HTTP 报文结构是怎样的?

  • HTTP有哪些请求方法?

  • GET 和 POST 有什么区别?

  • 如何理解 URI?

  • 如何理解 HTTP 状态码?

  • 简要概括一下 HTTP 的特点?HTTP 有哪些缺点?

  • 对 Accept 系列字段了解多少?

  • 对于定长和不定长的数据,HTTP 是怎么传输的?

  • HTTP 如何处理大文件的传输?

  • HTTP 中如何处理表单数据的提交?

  • HTTP1.1 如何解决 HTTP 的队头阻塞问题?

  • 对 Cookie 了解多少?

  • 如何理解 HTTP 代理?

  • 如何理解 HTTP 缓存及缓存代理?

  • 为什么产生代理缓存?

  • 源服务器的缓存控制

  • 客户端的缓存控制

  • 什么是跨域?浏览器如何拦截响应?如何解决?

    开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

},{

id: 13,

label: “count”}]},

{

id: 10,

label: “table2”,

children: [{

id: 14,

label: “rq2”},{

id: 15,

label: “wlbm2”

},{

id: 16,

label: “armt”}]}]},

{

id: 20,

label: “视图”,

children: [{

id: 17,

label: “view1”},{

id: 18,

label: “view2”}]}]},

{

id: 2,

label: “数据源2”,

children: [{

id: 5,

label: “二级 2-1”},

{

id: 6,

label: “二级 2-2”}]

},{

id: 3,

label: “数据源3”,

children: [{

id: 7,

label: “二级 3-1”

},{

id: 8,

label: “二级 3-2”}]}],

defaultProps: {

children: “children”,

label: “label”

}};},

methods: {

onMove(e) { //拖拽事件 https://blog.csdn.net/Kiruthika/article/details/123903706 可查看相关配置

if (

JSON.stringify(e.relatedContext.list).includes(

JSON.stringify(e.draggedContext.element)

) === true

) {

return false;

} else {

return true;

}

},

toChange(e) {//拖拽事件

console.log(e);

},

onSubmit() {

console.log(“submit!”);

console.log(this.form);

},

//节点点击事件

handleNodeClick(data, node) {

//记录点击次数

this.treeClickCount++;

//单次点击次数超过2次不作处理,直接返回,也可以拓展成多击事件

if (this.treeClickCount >= 2) {

return;

}

//计时器,计算300毫秒为单位,可自行修改

this.timer = window.setTimeout(() => {

if (this.treeClickCount == 1) {

//把次数归零

this.treeClickCount = 0;

//单击事件处理

// console.log(data);

// console.log(node);

} else if (this.treeClickCount > 1) {

//把次数归零

this.treeClickCount = 0;

//双击事件

this.rowList = [];

this.getParent(node);

// this.fieldarr.push(this.rowList.join(‘.’))

// console.log(data.children, “—>rowList”);

if (data.children === undefined || data.children.length === 0) {

if (this.fieldarr.indexOf(…[this.rowList.join(“.”)]) == -1) {

this.fieldarr.push(this.rowList.join(“.”));

this.fieldarr2.push({

name: this.rowList.join(“.”),

id: data.id

});

// console.log(this.fieldarr2, “—>rowList”);

} else {

this.$message.error(“选择字段重复”);

}

} else {

this.$message.error(“不能选表名,请选择字段”);

}

}

}, 300);

},

getParent(node) {

var that = this;

if (node.parent.data && !Array.isArray(node.parent.data)) {

node.parent.data instanceof Object &&

that.rowList.unshift(node.data.label);

that.getParent(node.parent);

} else if (that.rowList.length === 0) {

if (that.parentList.length === 0) {

that.rowList.unshift(node.data.label);

}

} else {

that.rowList.unshift(node.data.label);}}}};

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值