
react
zoepriselife316
这个作者很懒,什么都没留下…
展开
-
react Antd 的面包屑与导航使用例子
使用面包屑,当点击不同二级导航,显示不同面包屑,代码重点是:在Layout渲染的页面中:import React from "react";import "./style.scss";import { Link } from "react-router-dom";import { observer, inject } from "mobx-react";import { Layout,...原创 2020-08-14 14:08:20 · 7775 阅读 · 0 评论 -
npmError: EPERM: operation not permitted,...
create-react-app react-antd-democd react-antd-demonpm run start想使用antd,安装antdnpm install antd直接报错:npm ERR! Error: EPERM: operation not permitted, unlink ‘e:\Users\zoe\Desktop\ReactStudy\antd-hooks-demo\node_modules.staging\antd-bc74d47f\dist\antd.原创 2020-06-28 14:48:18 · 693 阅读 · 0 评论 -
webpack-internal:///../node_modules/rc-util/lib/warning.js:20 Warning: [antd: LocaleProvider] `Local
webpack-internal:///…/node_modules/rc-util/lib/warning.js:20 Warning: [antd: LocaleProvider] LocaleProvider is deprecated. Please use locale with ConfigProvider instead:翻译出来就是webpack internal:///…/n...原创 2019-12-06 17:19:07 · 9860 阅读 · 4 评论 -
TypeError: react__WEBPACK_IMPORTED_MODULE_0___default.a.createClass is not a function
×TypeError: react__WEBPACK_IMPORTED_MODULE_0___default.a.createClass is not a functionModule…/src/pages/app/line.jsxC:/zoeCode/study/react/reactApp/src/pages/app/line.jsx:110107 | import React fro...原创 2019-12-04 16:16:14 · 4682 阅读 · 0 评论 -
react 使用antd 的table组件,批量操作后还存留之前的打钩项
官网提供一个方法代码如下:import { Table, Button } from 'antd';const columns = [{ title: '姓名', dataIndex: 'name',}, { title: '年龄', dataIndex: 'age',}, { title: '住址', dataIndex: 'address',}];con...原创 2019-10-11 17:31:03 · 1424 阅读 · 0 评论 -
react中使用水印water-mark-oc
下载:npm install water-mark-oc --save下载完,在页面中: import watermark from 'water-mark-oc' // 在该生命周期调用即可 componentDidMount() { // 水印 let user ='Admin' if(user){ water...原创 2019-09-17 18:31:35 · 2129 阅读 · 0 评论 -
react中使用antd的二级菜单点击一个其他关闭
直接上代码以下是官网的例子import { Menu, Icon } from 'antd';const { SubMenu } = Menu;class Sider extends React.Component { // submenu keys of first level //带下拉的submenu rootSubmenuKeys = ['sub1', 'sub2'...原创 2019-09-17 14:20:20 · 2563 阅读 · 0 评论 -
react中使用antd的表单重置数据
resetFields 重置一组输入控件的值(为 initialValue)与状态,如不传入参数,则重置所有组件 Function([names: string[]]) 注:initialValue有值时会重置为initialValue使用://这个事件,可以是click可以是生命周期函数,具体看需求componentWillUnmount() { this.props.for...原创 2019-08-19 17:47:15 · 10090 阅读 · 0 评论 -
electron打包遇到的问题
这是我配置的scripts:"scripts": { "start": "node scripts/start.js", "build": "rm -rf ./build && node scripts/build.js", "test": "node scripts/test.js", "electron": "electron .", ...原创 2019-07-09 18:16:25 · 16975 阅读 · 1 评论 -
react中父子组件传函数,报错Uncaught TypeError: this.setState is not a function
Uncaught TypeError: this.setState is not a function at Object.huoqu (config.jsx?755c:128) at Object.huoqu (react-hot-loader.development.js?6f2c:693) at ProxyComponent.eval (cronexpression1...原创 2019-06-26 10:38:41 · 5728 阅读 · 0 评论 -
create-react-app和electron报错fs.existsSync is not a function
将create-react-app与electron创建出的一个项目中。React中无法使用electron当在React中使用require(‘electron’)时就会报TypeError: fs.existsSync is not a function的错误。因为React中无法使用Node.js的模块.所以,百度了下:方案如下创建renderer.js文件global.el...原创 2019-05-07 14:26:28 · 25738 阅读 · 24 评论 -
create-react-app与antd一起使用The "injectBabelPlugin" helper has been deprecated as of v2.0. You can use
全局安装create-react-appnpm install create-react-app -g//用它创建项目create-react-app react-demo//启动项目npm run start然后安装antdnpm install antd --save按需引入Ant-Design插件需要两个插件:1、react-app-rewired(一个对 cre...原创 2019-04-30 15:52:21 · 3975 阅读 · 7 评论 -
Failed to compile: Import in body of module; reorder to top import/first
Failed to compile./src/routes/index/index.jsxLine 5: Import in body of module; reorder to top import/firstimport应该在所有业务代码的上方,(eslint 暴出),果断看下我的代码,写错位置了换下位置就可以了...原创 2019-04-19 15:55:18 · 604 阅读 · 0 评论 -
项目中遇到一个问题,怎么解析后台返回数据中\r\n
项目中遇到一个问题,怎么解析后台返回数据中\r\n后台返回的json数据中,前端对这些数据进行换行操作,可能不是那么友好,后端直接返回的数据中 "\r\n|\n\r"可能不起作用,百度了下,有很多说直接替换的...原创 2019-04-09 18:39:56 · 3653 阅读 · 1 评论 -
react+electron+AntD编辑桌面应用
一、开发的首要任务,安装node环境https://nodejs.org/zh-cn/,需要自行下载二、要下载react,有一个快捷的方法,创建react应用,使用脚手架,下载(可选择是否全局安装):npm install --global create-react-app成功运行后会显示:三、创建react项目:create-react-app demo新建完后,按着步骤执行...原创 2019-03-01 16:45:27 · 11505 阅读 · 11 评论 -
'react-scripts' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 error Command failed with exit code 1.aPritice\\JieDe\\e
本地使用create-react-app脚手架新建项目,因为下载了其他的包,改了一些文件,可能对这个项目的启动项产生了影响,导致包不全了,运行react项目时,报错'react-scripts' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 error Command failed with exit code 1.aPritice\\dfd\\electron\\react-elec...原创 2019-03-01 10:56:14 · 5367 阅读 · 0 评论 -
React提交请求的时候页面重复刷新
React提交请求的时候页面重复刷新原因:触发了form的提交submit事件,form的提交默认刷新页面所以要通过取消默认事件preventDefault请求的时候,添加事件对象e,然后取消他的默认事件就可以了…update = (e) => { e.preventDefault() console.log('内容修改了')} ...原创 2019-02-27 19:04:17 · 2396 阅读 · 0 评论