09 2021 档案
写组件库文档常用的技术
摘要:1.storybook 2.docsify 3.vuepress 4.dumi
阅读全文
document.execCommand 的用法
摘要:selectAll 全选 无参数 open – – stop 执行浏览器停止命令,避免加载后续无用资源 saveAs – – print – – Cut 剪切选中文字 (“Cut”, “false”, null); FontName 改变选中文字字体 参数:文字字体名称 FontSize – 参数:
阅读全文
手写JSON.stringify
摘要:// string -> string `"${string}"` // number -> `${number}` // bigInt -> throw new Error('Do not know how to serialize a BigInt at JSON.stringify'); //
阅读全文
Object常用方法
摘要:Object.assign(target,source1,source2,...) 该方法主要用于对象的合并,将源对象source的所有可枚举属性合并到目标对象target上,此方法只拷贝源对象的自身属性,不拷贝继承的属性。 Object.assign方法实行的是浅拷贝,而不是深拷贝。也就是说,如果
阅读全文
手写lodash.set
摘要:// 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用 function toArrayPath(path) { if (Array.isArray(path)) { return path; }
阅读全文
说一下http请求头响应头
摘要:1、什么是 HTTP 请求头/响应头 请求头 当你使用http(https)协议请求一个网站的时候,你的浏览器会向对方的服务器发送一个http请求,这个请求同样包含三个部分 请求方法 请求路径(URL) 请求协议版本 报文主体 (POST/GET)参数 这里是一个请求头的示例 这些讯息里面包含了你的
阅读全文
手写lodash.get
摘要:1.简单版 /** * @param {object} source * @param {string | string[]} path * @param {any} [defaultValue] * @return {any} */ function get(source, path, defau
阅读全文
vite常用配置
摘要:import {defineConfig} from 'vite' import vue from '@vitejs/plugin-vue' import vitePluginImp from 'vite-plugin-imp' import path from 'path' const isPro
阅读全文
react中使用ueditor和秀米
摘要:下载 github: npm i https://gitee.com/ygunoil/react-ueditor-xiumi.git -S npm: npm i react-ueditor-xiumi -S yarn: yarn add react-ueditor-xiumi 使用 引入 Uedit
阅读全文
js使用y-qrcode生成二维码
摘要:<div ref="qrCode" id="qrcode" ></div> import QRCode from "y-qrcode"; var qrcode = new QRCode(document.getElementById("qrcode"), { text: 'your content'
阅读全文
js使用y-seal实现印章功能
摘要:npm i y-seal -D <canvas id="seal"></canvas> import Seal from "y-seal"; var seal = new Seal("#seal", { radius: 75,// 默认半径75px color: "red",// 默认颜色红色 co
阅读全文