zoukankan      html  css  js  c++  java
  • vue 异步改同步 获取结果 动态函数

    获取异步函数的结果

    //根据路径去读取文件
            async getContentByPath(val){
                let address = val.data.contentPath && decodeURI(val.data.contentPath.split("path=")[1])
                const res = await this.$ajax.get(this.url.getContentByPath, { path: address })
                if (res.code == 200) {
                    return  res.data
                }
            },

    动态函数 

    //处理增删改
            handleNode(obj) {
                let operType = this.oper[obj.i]["type"]
                const treeName = obj.treeName
                const value = Object.assign(obj.d,{operType,treeName})
                this.operCurrentNode = value
                try {
                    eval("this." + operType + "(value)")
                    //this[operType](value)
                } catch (e) {
                    this.nodeOthers(operType,value)
                }
            },

    //处理增删改        handleNode(obj) {            let operType = this.oper[obj.i]["type"]            const treeName = obj.treeName            const value = Object.assign(obj.d,{operType,treeName})            this.operCurrentNode = value            try {                eval("this." + operType + "(value)")                //this[operType](value)            } catch (e) {                this.nodeOthers(operType,value)            }        },

  • 相关阅读:
    集合(set)
    字典方法
    字典(dict)
    元组(tuple)
    列表方法
    xxxx(四):接受消息hook地址分析
    xxxx(三)“黑吃黑”: 破解别人外挂
    UDP内网穿透和打洞原理与代码实现
    VMP加壳(三):VMP壳爆破实战-破解某编辑类软件
    VMP加壳(二):VMP的虚拟化原理
  • 原文地址:https://www.cnblogs.com/pengfei25/p/13072398.html
Copyright © 2011-2022 走看看