• vue2.0 代码功能片段


    1、代码片段截取

    checkAll: function(flag){
              this.checkAllFlag = flag;
              this.productList.forEach(function(value,index){
                 value.checked = flag;
                  })
                this.calcTotalPrice();
        },
    2、es6语法,解构赋值
    const {shell} = require(‘electron’);大括号什么意思
    
    
    

       3、本地存取;

       /**
             * 向localStorage中设置数据
             * @param key   字符串
             * @param value 数组
             */
            function SetDataIntoLocalStorage(key, value) {
                localStorage.setItem(key, JSON.stringify(value));
            };
    
            /**
             * 从localStorage中获取数据
             * @param key   字符串
             */
            function GetDataFromLocalStorage(key) {
                return JSON.parse(localStorage.getItem(key));
            }
    
            $timeout(function(){
                //ipcRenderer.send('settingsWindowInitFinished');
            });
        }]);
    

     4、比较函数

    sort(function(a,b){
    return a -b ;
    })
    

     5、Electron clipboard 模块

    Electron clipboard 模块
    
    clipboard 模块提供方法来供复制和粘贴操作 . 下面例子展示了如何将一个字符串写道 clipboard 上:
    
    const clipboard = require('electron').clipboard;
    clipboard.writeText('Example String');
    
    在 X Window 系统上, 有一个可选的 clipboard. 你可以为每个方法使用 selection 来控制它:
    
    clipboard.writeText('Example String', 'selection');
    console.log(clipboard.readText('selection'));
    
     
  • 相关阅读:
    gcc 编译
    UltraEdit 添加到右键菜单
    linux 编译错误:undefined reference to `__gxx_personality_v0'
    UltraEdit 取消生成.bak文件
    容器
    Windows CEvent事件
    Windows _beginthreadex 线程类与线程池
    C++ 工厂模式
    Mutex linux线程锁
    windows CRITICAL_SECTION 线程锁
  • 原文地址:https://www.cnblogs.com/sxz2008/p/6812188.html
Copyright © 2020-2023  润新知