热门 java spring修改默认views

时间:2019-7-9   作者:lininn   分类:   热度:1893°    
时间:2019-7-9   分类:    热度:1893  
进入src /main/resources/servlet/ 修改sevlet-context.xml,之后找到14行 <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"> <property name="resourceLoaderPath" value="/views_source/" /> <property name="configLocation" value="classpath:vel...

阅读全文>>

热门 gulp自动给css,js批量添加版本号,解决缓存

时间:2019-7-8   作者:lininn   分类:   热度:2040°    
时间:2019-7-8   分类:    热度:2040  
每次css或js文件修改之后,浏览器因有缓存而无法及时的呈现最新的页面内容。 解决方法:用gulp自动给html引入的css,js文件批量添加版本号 原html效果: <link rel="stylesheet" href="css/index.css"> <script src="js/index.js"></script> 完成效果 <link rel="stylesheet" href="css/index.css?v=d917434f5d"> <script src="js/index.js?v=1...

阅读全文>>

热门 node递归获取文件夹下所有文件

时间:2019-7-8   作者:lininn   分类:   热度:2883°    
时间:2019-7-8   分类:    热度:2883  
var path = require("path"); var fs = require("fs"); console.log(__dirname) let components = []; var arrFiles=[]; var str=__dirname+"/css/"; function load(val){ const files = fs.readdirSync(val) files.forEach(function (item, index) { let stat = fs.lstatSync(val+item) if (stat.i...

阅读全文>>

热门 form表单提交不跳转

时间:2019-7-5   作者:lininn   分类:   热度:1875°    
时间:2019-7-5   分类:    热度:1875  
方案一 <html> <body> <form action="" method="post" target="nm_iframe"> <input type="text" id="id_input_text" name="nm_input_text" /> <input type="submit" id="id_submit" name="nm_submit" value="提交" /> </form> <iframe id="id_iframe" name="nm_iframe" ...

阅读全文>>

热门 react兼容ie

时间:2019-6-27   作者:lininn   分类:   热度:2552°    
时间:2019-6-27   分类:    热度:2552  
使用最新版本的 create-react-app(v2.1.0)创建 react 项目时,在 IE 9 & IE 10 中碰到了"Map未定义"的报错: 很明显,这是 IE9 对 ES6 的兼容性问题。首先尝试了两种方式: 使用 create-react-app 官方提供的 react-app-polyfill,然后在入口文件 index.js 中引入: import 'react-app-polyfill/ie9' 根据 react 官方文档,使用 core-js 引入 polyfill: ...

阅读全文>>

热门 react fetch封装

时间:2019-6-27   作者:lininn   分类:   热度:2277°    
时间:2019-6-27   分类:    热度:2277  
reruest.js: /** * 让fetch也可以timeout * timeout不是请求连接超时的含义,它表示请求的response时间,包括请求的连接、服务器处理及服务器响应回来的时间 * fetch的timeout即使超时发生了,本次请求也不会被abort丢弃掉,它在后台仍然会发送到服务器端,只是本次请求的响应内容被丢弃而已 * @param {Promise} fetch_promise fetch请求返回的Promise * @param {number} [timeout=120000] 单位:毫秒,这里设置默认超时时间为10秒 ...

阅读全文>>

热门 react根元素添加元素 body添加元素

时间:2019-6-27   作者:lininn   分类:   热度:5947°    
时间:2019-6-27   分类:    热度:5947  
import React from 'react'; import ReactDOM from 'react-dom'; class NewPortal extends React.Component { constructor(props) { super(props) this.node = document.createElement('div'); document.body.appendChild(this.node); } render() { const { children } = this.props; ...

阅读全文>>

热门 react使用antd设置menu

时间:2019-6-26   作者:lininn   分类:   热度:3637°    
时间:2019-6-26   分类:    热度:3637  
构建menu组件: import React from 'react' import {Link,withRouter} from 'react-router-dom' import {Menu, Icon} from 'antd' //此组件的意义就是将数据抽离出来,通过传递数据去渲染 @withRouter class CustomMenu extends React.Component { state = { openKeys: [], selectedKeys: [] } componentDidMount() { ...

阅读全文>>

热门 原 React 监听屏幕尺寸变化

时间:2019-6-21   作者:lininn   分类:   热度:2995°    
时间:2019-6-21   分类:    热度:2995  
1.在componentDidMount()中加入监听器 componentDidMount() {     this.screenChange(); }  screenChange() {      window.addEventListener('resize', this.resize);  } resize()方法中,定义了屏幕尺寸变化后需要执行的代码 2.在constructor中绑定resize() constructor(props) {     this.r...

阅读全文>>

返回顶部    首页    手机版本    后花园   会员注册   
版权所有:覆手为雨    站长: lininn