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
<message> | |
<div class="msg-box bg-{ opts.type || 'info' } fade-{ fadeMode }" if={ opts.text }> | |
<button type="button" class="close" onclick={ closeBox } if={ opts.close }> | |
<span aria-hidden="true">×</span><span class="sr-only">Close</span> | |
</button> | |
<h4 class="msg-title" if={ opts.title }>{ opts.title }</h4> | |
<ul class="msg-body"> | |
<!-- <li><yield/></li> --> |
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
/** | |
* HashHistory | |
* @link https://zhuanlan.zhihu.com/p/27588422 | |
*/ | |
// hash的改变会自动添加到浏览器的访问历史记录中。 | |
function pushHash (path) { | |
window.location.hash = path | |
} |
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 extra = {} | |
// 密码检测密码强度 | |
extra.checkStrength = function (sValue) { | |
let modes = 0 | |
if (sValue.length < 1) return modes | |
// 正则表达式验证符合要求的 |
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
// @from http://www.cnblogs.com/kazetotori/p/6037940.html | |
// ajax函数的默认参数 | |
var ajaxOptions = { | |
url: '#', | |
method: 'GET', | |
async: true, | |
timeout: 0, | |
data: null, | |
dataType: 'text', | |
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
const baseUrl = 'xx.com/' | |
export default async(url = '', data = {}, type = 'GET', method = 'fetch') => { | |
type = type.toUpperCase(); | |
url = baseUrl + url; | |
if (type == 'GET') { | |
let dataStr = ''; //数据拼接字符串 | |
Object.keys(data).forEach(key => { | |
dataStr += key + '=' + data[key] + '&'; |
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
<style> | |
[data-anchor-icon]::after { | |
content: attr(data-anchor-icon); | |
} | |
</style> | |
<div id="content-toc-box"> | |
<div class="title"><i class="fa fa-list"></i> 内容结构</div> | |
<div id="content-toc"></div> | |
</div> |
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
"scripts": { | |
"analyze": [ | |
"@cs:check", | |
"@phpstan", | |
"@composer validate --strict" | |
], | |
"phpstan": [ | |
"wget -nc https://github.com/phpstan/phpstan/releases/download/0.9.1/phpstan.phar", | |
"chmod a+x phpstan.phar", | |
"./phpstan.phar analyse src tests --level=2 -c phpstan.neon --no-interaction --no-progress" |
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
# link https://github.com/humbug/box/blob/master/Makefile | |
#SHELL = /bin/sh | |
.DEFAULT_GOAL := help | |
# 每行命令之前必须有一个tab键。如果想用其他键,可以用内置变量.RECIPEPREFIX 声明 | |
# mac 下这条声明 没起作用 !! | |
.RECIPEPREFIX = > | |
.PHONY: all usage help clean | |
# 需要注意的是,每行命令在一个单独的shell中执行。这些Shell之间没有继承关系。 | |
# - 解决办法是将两行命令写在一行,中间用分号分隔。 |
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
server { | |
listen 80; | |
server_name www.site.dev site.dev; | |
root /webroot/static; | |
index index.html index.htm; | |
error_log logs/site.dev.error.log; | |
access_log logs/site.dev.access.log; | |
##### 第一个必选规则: 匹配首页 |
OlderNewer