2020年3月31日

React (redux store reducers(1个) reducer(1个组件1个 包含多个function函数 ) action(对象) dispatch)(react-redux redux-actions redux-immutable redux-thunk 异步redux )flux

摘要: //compose 组成 combine 联合 import {applyMiddleware, createStore, compose, combineReducers} from 'redux'; import { bindActionCreators } from "redux"; impo 阅读全文

posted @ 2020-03-31 15:49 左侧岚 阅读(376) 评论(0) 推荐(0) 编辑

reset.css

摘要: @charset "utf-8"; /* CSS Document */ html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img { margin:0; padding:0; 阅读全文

posted @ 2020-03-31 15:18 左侧岚 阅读(236) 评论(0) 推荐(0) 编辑

webpack打包出错 连续同一个命令打包 堆栈错误

摘要: npm run build:prod 可以成功 9M 不能连续同一个命令打包 ng build --prod --build-optimizer 阅读全文

posted @ 2020-03-31 15:16 左侧岚 阅读(139) 评论(0) 推荐(0) 编辑

git操作

摘要: git checkout develop git pull git checkout zhanglan git merge develop 错误: 查看代码中有没有冲突 出现 zhanglan|mergine git add . git commit -m "" git push提交 git con 阅读全文

posted @ 2020-03-31 15:02 左侧岚 阅读(85) 评论(0) 推荐(0) 编辑

js如何判断一个对象{}是否为空对象,没有任何属性,为空对象的几种方法

摘要: 1.将json对象转化为json字符串,再判断该字符串是否为"{}" var data = {}; var b = (JSON.stringify(data) == "{}"); alert(b);//true 2.for in 循环判断 var obj = {}; var b = function 阅读全文

posted @ 2020-03-31 14:55 左侧岚 阅读(839) 评论(0) 推荐(0) 编辑

页面样式 窗口大小

摘要: <ul [ngStyle]="{'width': widths? widths + 'px': widths + 'px'}"></ul> import * as $ from 'jquery'; this.widths = $('.search').width() - 89; $(".tabPan 阅读全文

posted @ 2020-03-31 14:37 左侧岚 阅读(81) 评论(0) 推荐(0) 编辑

Angular2路由 上线后页面刷新后报404错误

摘要: 点击路由链接跳转页面是正常的,但是当刷新页面时就出现了404错误。 解决方法如下: 在app.module.ts中添加import: import {HashLocationStrategy,LocationStrategy} from '@angular/common'; 并在 providers 阅读全文

posted @ 2020-03-31 12:38 左侧岚 阅读(251) 评论(0) 推荐(0) 编辑

React 上传进度条问题 原生js上传 input type=“file”

摘要: canUpload: true,//是否可以上传,初始值不可上传,所以disabled为truefilename: '',//上传文件的名称 loading: false,//点击上传的时候出现加载图标 fileList: [],//已上传的文件列表 isNumber: true,//判断数量是否为 阅读全文

posted @ 2020-03-31 12:34 左侧岚 阅读(1136) 评论(0) 推荐(0) 编辑

Angular2 判断上传的.txt文件内容是不是对象 如果上传文件列表有一个了 则替代之前的文件 如果上传文件不是.txt文件 则清空上传文件列表

摘要: if(this.documentUpload.substr(0,1) == '{' && this.documentUpload.substr(-1,1) == '}'){} if(this.fileList.length > 1){ this.fileList = this.fileList.sl 阅读全文

posted @ 2020-03-31 10:15 左侧岚 阅读(438) 评论(0) 推荐(0) 编辑

正则表达式

摘要: // 全部小写 首字母不能数字 只能小写 后面数字小写都可以 const reg = /^[a-z0-9]+.?[a-z0-9]*$/; if (reg.test(value) || value '' || value '-') { }else{ //页面上显示格式不正确 } //== -1 没有找 阅读全文

posted @ 2020-03-31 09:59 左侧岚 阅读(126) 评论(0) 推荐(0) 编辑

React Modal对话框

摘要: Modal.confirm({ title: '确定禁用该项目?', content: '项目禁用后可以禁用', okText: '禁用', okType: 'danger', cancelText: '取消', className: 'tingzhiss', async onOk() { }, o 阅读全文

posted @ 2020-03-31 09:44 左侧岚 阅读(909) 评论(0) 推荐(0) 编辑

window用法 跳转

摘要: // _blank _self window.open("https://casserver.com:8443/cas/logout?service=http://10.10.111.22:8080",'_self').location; window.location.href="#taskin? 阅读全文

posted @ 2020-03-31 09:36 左侧岚 阅读(206) 评论(0) 推荐(0) 编辑

通过js设置样式

摘要: if(document.getElementById("B").style.display == 'none'){ document.getElementById("B").style.display = "flex" document.getElementById("B").style['alig 阅读全文

posted @ 2020-03-31 09:35 左侧岚 阅读(244) 评论(0) 推荐(0) 编辑

localStorage sessionStorage JSON.parse JSON.stringify 1个用户好几个权限 用户如果存在某个权限 显示不同页面 存在的问题 当前页面保存到storage里了 复制路径打开新的页面 storage里的数据不同步复制过来 只能保存JSON字符串 不能保存字符串数组

摘要: 存 var storage = window.sessionStorage; storage.setItem('user',JSON.stringify(result['data']['permissions'])); 取 var storage = window.sessionStorage; l 阅读全文

posted @ 2020-03-31 09:33 左侧岚 阅读(178) 评论(0) 推荐(0) 编辑

导航