随笔分类 - 前端知识
摘要:import { message } from 'antd' export function getBlob(url: string): Promise<any> { return new Promise(resolve => { const xhr = new XMLHttpRequest() x
阅读全文
摘要:代码: let arr = [{name:'白鸽',year:'2022',month:'2'},{name:'麻雀',year:'2022',month:'3'},{name:'白鸽',year:'2022',month:'8'},{name:'大象',year:'2021',month:'9'}
阅读全文
摘要:上代码: import React, {Component} from 'react' import Pdfh5 from 'pdfh5' import 'pdfh5/css/pdfh5.css' class Index extends Component { constructor(props)
阅读全文
摘要:Object.prototype.toString.call() 精准判断对象的类型 其余参考:https://blog.csdn.net/honeymoon_/article/details/120307545
阅读全文
摘要:antd貌似也可以试着参考一下,代码如下: <Tree className="yige-tree" treeData={treeData} value={selTreeData} defaultValue={selTreeData || []}//回显加载之前选中的数据 multiple expan
阅读全文
摘要:react-diff-viewer依赖的是react16,对于17版本来说,只能使用react-diff-view做文本对比(目前只发现了这个) 效果: 代码: import React, { Component } from "react"; import "react-diff-view/sty
阅读全文
摘要:转载自: https://xie.infoq.cn/article/cadf9a45c25be872cd7dfe17d
阅读全文
摘要:const recursionFileMap = obj => { let arr = [] as any obj.map(item => { let obj = { name1: '', children: [], } obj.name1 = item.name if (item.children
阅读全文
摘要:只有一层子路由的时候在页面加入 <Outlet /> 就可以了,但是子路由下面还有子路由这样的多层嵌套除了页面要有这个react-router-dom自带的组件以外还要在路由列表加入,如下: { path: 'event', element: <Event />, title: '事件', icon
阅读全文
摘要:一般来讲antd的文本内容都是经过处理的,不加入任何的html渲染,但是想要实现和vue的v-html一样的功能,就需要如下写法在column的数组中(这里用的动态列) { title: item, dataIndex: item, key: item, width: 180, render: (t
阅读全文
摘要:./node_modules/.bin/sentry-cli releases --org "dd30d4265d58" new '1.0.0.0' --project "react"
阅读全文
摘要:option = { tooltip: { trigger: 'axis', }, xAxis: [ { type: 'category', data: ['2016', '2017', '2018', '2019'], axisLine: { lineStyle: { color: '#999',
阅读全文
摘要:const list=[ {value: 1048, name: '搜索引擎'}, {value: 735, name: '直接访问'}, {value: 580, name: '邮件营销'}, {value: 484, name: '联盟广告'}, {value: 300, name: '视频广告
阅读全文
摘要:如果打包的文件需要压缩,请参考node 的 archiver 插件使用 (转载:https://blog.csdn.net/harmsworth2016/article/details/82214736) 正常情况下的打包如下: const { NodeSSH } = require("node-s
阅读全文
摘要:初步探明 问题如下: 解决办法:
阅读全文
摘要:原因在于validator或者default已经不能适用vue2的写法去编写,不然编译出来的TS很奇怪,打包成插件后引入并且传参的时候编译过程总会报类型不对的问题,后来看了下vue的官网,写法如下: 问题解决,编译后的样子:
阅读全文
摘要:for await (let key of Object.keys(dict)) { //你的API let ret = await getApiData(comp, key); if (ret) { let tmpObj = { count: ret++, }; obj = tmpObj; } }
阅读全文
摘要:import { defineConfig, UserConfigExport, ConfigEnv } from "vite"; import externalGlobals from "rollup-plugin-external-globals"; import vue from "@vite
阅读全文
摘要:slot: vue3推荐v-slot的写法,类似@和:v-slot也可以简化为#符号,demo如下: 子组件写法不变: <template> <div> hello: <slot name="fruits" :fruitsName="obj.name" :freshness="obj.freshne
阅读全文
摘要:可能遇见的问题: react-jsx-dev-runtime.development.js:117 Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/functi
阅读全文

浙公网安备 33010602011771号