摘要:
// 判断一个字符串是否是json格式 export const isJson = str => { try { const jsonObj = JSON.parse(str) if ('string' typeof str && 'object' typeof jsonObj) return tr 阅读全文
posted @ 2022-03-16 14:13
吴小明-
阅读(1181)
评论(0)
推荐(0)
1、安装: npm install react-viewer --save 2、组件:ImgViewer/index.tsx import React, { useState, useImperativeHandle } from 'react' import Viewer from 'react- 阅读全文
一、MenuSearch/index.tsx import React, { useState, useEffect } from 'react' import { Select } from 'antd' import { history } from 'umi' import styles fr 阅读全文
1、仪表盘组件 GaugeChart/index.tsx(组件中的nightFlag是适配黑夜模式,获取公共状态中的值) import React, { useEffect, useRef } from 'react' import styles from './index.less' import 阅读全文
main.js import { Toast } from 'vant' window.alert = str => Toast(str) // 全局替换alert 使用场景:如果系统中引入了一些插件,插件中使用的提示是alert,这种方式的提示不友好,可以全局将系统中的alert替换为UI组件库中 阅读全文