This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 设置请求头来实现跨域, 允许请求头和方法 | |
app.use((req, res, next) => { | |
res.header("Access-Control-Allow-Origin", "*") | |
res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With") | |
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS") | |
next() | |
}) | |
// 设置前端可以从响应头中获取那些信息 | |
Access-Control-Expose-Headers : '要获取的响应头中的舰值' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="number" ...> | |
<style> | |
input::-webkit-outer-spin-button, | |
input::-webkit-inner-spin-button { | |
-webkit-appearance: none; | |
} | |
input[type="number"]{ | |
-moz-appearance: textfield; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
babel的loader | |
babel-core | |
babel-loader | |
babel-preset-es2015 | |
不知道作用的 | |
babel-plugin-add-module-exports | |
babel-plugin-syntax-dynamic-import | |
babel-plugin-transform-es2015-modules-umd | |
配合eslint使用的 | |
babel-eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chunks = []; | |
var size = 0; | |
res.on('data', function (chunk) { | |
chunks.push(chunk); | |
size += chunk.length; | |
}); | |
res.on('end', function () { | |
var data = null; | |
switch(chunks.length) { | |
case 0: data = new Buffer(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--使用 viewport meta 标签在手机浏览器上控制布局--> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" /> | |
<!--通过快捷方式打开时全屏显示--> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<!--隐藏状态栏--> | |
<meta name="apple-mobile-web-app-status-bar-style" content="blank" /> | |
<!--iPhone会将看起来像电话号码的数字添加电话连接,应当关闭--> | |
<meta name="format-detection" content="telephone=no" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
overflow-y scroll | |
:root | |
overflow-y auto | |
overflow-x hidden | |
:root body | |
position absolute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 文本框根据输入内容自适应高度 | |
* @param {HTMLElement} 输入框元素 | |
* @param {Number} 设置光标与输入框保持的距离(默认0) | |
* @param {Number} 设置最大高度(可选) | |
*/ | |
autoTextarea (elem, extra, maxHeight) { | |
let _this = this | |
let fontSize = this.get_fontsize() | |
extra = extra || 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vModelBugfillMixin = { | |
data() { | |
return { | |
ownValue: null, | |
}; | |
}, | |
model: { | |
prop: 'valueFromProp', | |
}, | |
props: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Page Title</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
#loading { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Parcel Sandbox</title> | |
<meta charset="UTF-8" /> | |
</head> | |
<style> | |
.circle_process{ | |
position: relative; | |
width: 200px; | |
height : 200px; |
OlderNewer