随笔分类 -  js

摘要:参考:https://blog.csdn.net/glpghz/article/details/124359331 官网:http://www.sortablejs.com/index.html 安装 cnpm install sortablejs --save 引入 import Sortable 阅读全文
posted @ 2023-08-18 13:46 jqynr 阅读(163) 评论(0) 推荐(0)
摘要:加属性 <el-select v-model="queryParams.enterpriseIds" multiple collapse-tags placeholder="请选择" > 如果+1折行了,需要覆盖样式 ::v-deep .el-select .el-tag { max-width: 阅读全文
posted @ 2023-08-08 16:54 jqynr 阅读(494) 评论(0) 推荐(0)
摘要:参考:https://www.jianshu.com/p/2fa6c0d74b98 setOptions加第二个参数true this.chart.setOption(options, true); 阅读全文
posted @ 2023-08-08 15:00 jqynr 阅读(25) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/evanyanglibo/article/details/127851585 //复制文本 function copyText(text) { var element = createElement(text); element.select(); 阅读全文
posted @ 2023-07-10 09:13 jqynr 阅读(90) 评论(0) 推荐(0)
摘要:只能手动触发 fullscreenact() { if (this.isFullScreen) { document.exitFullscreen(); } else { document.documentElement.requestFullscreen(); } this.isFullScree 阅读全文
posted @ 2023-06-28 12:42 jqynr 阅读(15) 评论(0) 推荐(0)
摘要:依赖 echarts需要5.1.2以上 npm install echarts npm install echarts-gl 引入 import * as echarts from 'echarts'; import "echarts-gl"; 使用 </div> <div class="chart 阅读全文
posted @ 2023-02-07 11:38 jqynr 阅读(409) 评论(0) 推荐(0)
摘要:参考:https://www.yisu.com/zixun/353425.html // 金额转为大写 export function functiondigitUppercase(price) { const fraction = ["角", "分"]; const digit = ["零", " 阅读全文
posted @ 2022-12-03 14:40 jqynr 阅读(328) 评论(0) 推荐(0)
摘要:const formatTime = (date, hastime = true, separate = "/") => { const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getD 阅读全文
posted @ 2022-11-22 10:20 jqynr 阅读(269) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/qq_2411868438/article/details/124447051 try { array.forEach((element) => { if ((element.id == 3)) { throw Error("msg"); } }); 阅读全文
posted @ 2022-10-21 15:02 jqynr 阅读(43) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/weixin_43742708/article/details/106367046 arr = arr.sort((x, y) => { return x - y; }); 阅读全文
posted @ 2022-10-08 16:08 jqynr 阅读(24) 评论(0) 推荐(0)
摘要:参考:https://www.cnblogs.com/libin-1/p/7127481.html require ,import ,和 export>module 模块概念模块就是实现特定功能的一组方法。只要把不同的函数(以及记录状态的变量)简单地放在一起,就算是一个模块function m1() 阅读全文
posted @ 2022-09-13 12:00 jqynr 阅读(61) 评论(0) 推荐(0)
摘要:Math.round(area * 100) / 100 toFixed(2) 阅读全文
posted @ 2022-08-12 19:54 jqynr 阅读(83) 评论(0) 推荐(0)
摘要:框架 gridsome 生成静态网站 strapi 服务端api接口 vuepress 生成静态文档网站markdown Nuxt 静态文档网站,但主要还是SSR(server-side rendered)服务端渲染网站或app 库 lodash js的扩展,包括数组对象深度复制等 sortable 阅读全文
posted @ 2022-08-11 11:57 jqynr 阅读(42) 评论(0) 推荐(0)
摘要:3.行为型模式 >命令模式:数据驱动的设计模式,将被操作对象的方法包装成命令类,然后打包给调度类选择统一执行 // 命令接口 interface Order { execute(); } // 请求类,目标对象 class Stock { private name = "ABC"; private 阅读全文
posted @ 2022-07-29 17:18 jqynr 阅读(29) 评论(0) 推荐(0)
摘要:// js console console.clear(); console.log("console.log,show message, last recommand is console.clear"); console.info("console.info,other name for con 阅读全文
posted @ 2022-07-27 10:44 jqynr 阅读(118) 评论(0) 推荐(0)
摘要:split_array(arr, len) { var a_len = arr.length; var result = []; for (var i = 0; i < a_len; i += len) { result.push(arr.slice(i, i + len)); } return r 阅读全文
posted @ 2022-07-21 15:50 jqynr 阅读(695) 评论(0) 推荐(0)
摘要:1.创建型模式 >工厂模式:将创建对象过程单独封装,封装成方法 const Animal = function(this,name='',age=0){ this.name = name, this.age = age } const Tree = function(this,name='',tal 阅读全文
posted @ 2022-07-15 17:42 jqynr 阅读(38) 评论(0) 推荐(0)
摘要:////// 异步函数 ////回调,作为参数传递给另一个函数的函数(用函数作参数) function myDisplayer(some) { document.getElementById("demo").innerHTML = some; } function myCalculator(num1 阅读全文
posted @ 2022-07-09 10:12 jqynr 阅读(37) 评论(0) 推荐(0)
摘要:////// 类 // 使用关键字 class 创建,始终添加一个 constructor() 的方法(如果没有就会默认添加一个空的) class Car { constructor(name, year) { this.name = name; this.year = year; } age() 阅读全文
posted @ 2022-07-08 17:44 jqynr 阅读(66) 评论(0) 推荐(0)
摘要:////// 函数 const x = (x, y) => x * y; // 如果只有一句,可以省略return和大括号,最好加上 // 箭头函数没有 this,但是作为对象的属性可以有 //函数参数(parameter)指的是在函数定义中列出的名称。 //函数参数(argument)指的是传递到 阅读全文
posted @ 2022-07-08 17:03 jqynr 阅读(48) 评论(0) 推荐(0)