首页
更多应用
Search
1
修改iview的标签为i-的形式而不是驼峰的形式
3,132 阅读
2
PHP微信和企业微信签名
2,860 阅读
3
在VUE中怎么全局引入sass文件
2,510 阅读
4
解决Macos下storm系列IDE卡顿的问题
2,180 阅读
5
vscode硬件占用较高解决方案
2,159 阅读
默认分类
JS
VUE
CSS
mac使用技巧
React
fastmock
登录
/
注册
Search
标签搜索
react
js
vue
vscode
nodejs
项目
代码
webpack
工具
nginx
小程序
css
fastmock
eslint
npm
http
vue-cli3
git
浏览器
const
fastmock技术社区
累计撰写
104
篇文章
累计收到
26
条评论
首页
栏目
默认分类
JS
VUE
CSS
mac使用技巧
React
fastmock
页面
更多应用
搜索到
104
篇与
的结果
2019-01-03
linux环境下redis安装和启动
redis安装redis下载方式进入到/usr/local目录后使用wget从网上下载redis安装包wget http://download.redis.io/releases/redis-4.0.1.tar.gz从官网下载 https://redis.io/download 拷贝到/usr/local 目录解压下载下来的压缩包cd /usr/local tar redis-4.0.1.tar.gz!进入目录安装cd /usr/local/redis-4.0.1 make test make install执行完上诉命令安装后,redis所有的相关文件都会安装到当前目录下,其中,可执行文件redis-server或者redis-cli等都位于src目录下。启动redis服务. 在src目录下直接执行redis-server即可启动服务,这种方式启动的redis服务是在前台运行的,退出命令行工具后,redis服务就停止了。我们希望redis在后台运行。[root@redis_01 redis]# redis-server /etc/redis/sentinel.conf --sentinel 7980:X 23 Nov 18:02:41.348 * Increased maximum number of open files to 10032 (it was originally set to 1024). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.0.5 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in sentinel mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 26379 | `-._ `._ / _.-' | PID: 7980 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' 7980:X 23 Nov 18:02:41.355 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 7980:X 23 Nov 18:02:41.355 # Sentinel runid is 43de323d55627d896b2caf1da2e305f0eb59dcee 7980:X 23 Nov 18:02:41.356 # +monitor master mymaster 127.0.0.1 6379 quorum 1 ^C7980:signal-handler (1448273325) Received SIGINT scheduling shutdown... 7980:X 23 Nov 18:08:45.618 # User requested shutdown... 7980:X 23 Nov 18:08:45.618 # Sentinel is now ready to exit, bye bye... . 通过nohub方式启动,nohub redis-server /etc/redis/sentinel.conf --sentinel >> /var/log/redis.log&启动服务后,命令行会退出,并且将日志文件输出到/var/log目录下的redis.log文件中. 修改配置文件在sentinel.conf文件中加入下面的配置daemonize yes logfile "/var/log/sentinel_log.log"然后通过sentinel启动redis-server /usr/local/redis-4.0.1/sentinel.conf --sentinel后面的两种启动方式都会以后台的方式启动。如果不需要--sentinel通过sentinel启动,修改的配置文件就是redis.conf
2019年01月03日
930 阅读
0 评论
0 点赞
2019-01-02
nodemon+cross-env+config实现支持热更新的能根据不同环境加载不同配置的nodejs环境
nodejs项目中我们经常会用到nodemon启动项目以使我们的项目在开发时支持热更新,修改了代码后不需要手动重启服务器;使用npm 的config模块实现不同的环境(一般是develop,production,test);nodemon和config的使用方法这里不做详细介绍。cross-env的作用是不需要全局配置NODE_ENV在scripts脚本中修改NODE_ENV的值从而实现不同环境中proccess.env.NODE_ENV的不同,而config的工作原理就是基于NODE_ENV这个值的,所以推荐两者结合使用。先上三个工具结合使用后的配置文件。/package.json"scripts": { "dev": "nodemon ./bin/www --exec babel-node --presets es2015,stage-2", "start": "cross-env NODE_ENV=production babel-node ./bin/www --presets es2015,stage-2" }, "dependencies": { // ... other dependencies "config": "^3.0.1", "cross-env": "^5.2.0", // ... other dependencies }, "devDependencies": { // ... other devDependencies "nodemon"/nodemon.json{ "restartable": "rs", "ignore": [ ".git", "f2e", "node_modules/**/node_modules" ], "verbose": true, "execMap": { "js": "node --harmony" }, "events": { "restart": "osascript -e 'display notification \"App restarted due to:\n'$FILENAME'\" with title \"nodemon\"'" }, "env": { "NODE_ENV": "develop" }, "ext": "js,json" }nodemon的配置文档介绍的可以在scripts中一一配置,也可以在上面的配置文件中配置,我们建议在配置文件中配置,清晰明了还好管理。nodemon.json中跟本文相关的配置就是env->NODE_ENV配置项,他的值就对应设置了node环境中proccess.env.NODE_ENV的值,当执行npm run dev 时,proccess.env.NODE_ENV对应的是nodemon的配置文件中的值当执行npm run start 时, proccess.env.NODE_ENV对应的是cross-env设置的参数的值
2019年01月02日
1,045 阅读
0 评论
0 点赞
2018-12-29
Linux环境下Nginx详细安装部署教程
一、Nginx简介Nginx是一个web服务器也可以用来做负载均衡及反向代理使用,目前使用最多的就是负载均衡,具体简介我就不介绍了百度一下有很多,下面直接进入安装步骤二、Nginx安装1、下载Nginx及相关组件(我的软件目录为/software)[root@localhost software]# wget http://nginx.org/download/nginx-1.10.2.tar.gz 省略安装内容... [root@localhost software]# wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz 省略安装内容... [root@localhost software]# wget http://zlib.net/zlib-1.2.11.tar.gz 省略安装内容... [root@localhost software]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz 省略安装内容...安装c++编译环境,如已安装可略过[root@localhost software]# yum install gcc-c++ 省略安装内容... 期间会有确认提示输入y回车 Is this ok [y/N]:y 省略安装内容...2、安装Nginx及相关组件openssl安装[root@localhost software]# tar zxvf openssl-fips-2.0.10.tar.gz 省略安装内容... [root@localhost software]# cd openssl-fips-2.0.10 [root@localhost openssl-fips-2.0.10]# ./config && make && make install 省略安装内容...pcre安装[root@localhost software]# tar zxvf pcre-8.40.tar.gz 省略安装内容... [root@localhost software]# cd pcre-8.40 [root@localhost pcre-8.40]# ./configure && make && make install 省略安装内容...zlib安装[root@localhost software]# tar zxvf zlib-1.2.11.tar.gz 省略安装内容... [root@localhost software]# cd zlib-1.2.11 [root@localhost zlib-1.2.11]# ./configure && make && make install 省略安装内容...nginx安装[root@localhost software]# tar zxvf nginx-1.10.2.tar.gz 省略安装内容... [root@localhost software]# cd nginx-1.10.2 [root@localhost nginx-1.10.2]# ./configure && make && make install 省略安装内容...3、启动Nginx先找一下nginx安装到什么位置上了whereis nginx进入nginx目录并启动(启动指令为nginx)如果报如下错误“error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory,”按照下面方式解决1.用whereis libpcre.so.1命令找到libpcre.so.1在哪里 2.用ln -s /usr/local/lib/libpcre.so.1 /lib64命令做个软连接就可以了 3.用sbin/nginx启动Nginx 4.用ps -aux | grep nginx查看状态 [root@localhost nginx]# whereis libpcre.so.1 [root@localhost nginx]# ln -s /usr/local/lib/libpcre.so.1 /lib64 [root@localhost nginx]# sbin/nginx [root@localhost nginx]# ps -aux | grep nginx 进入Linux系统的图形界面,打开浏览器输入localhost会看到下图,说明nginx启动成功Welcome to nginx!If you see this page, the nginx web server is successfully installed and working. Further configuration is required.For online documentation and support please refer to nginx.org.Commercial support is available at nginx.com.Thank you for using nginx.nginx 基本操作启动 [root@localhost ~]# /usr/local/nginx/sbin/nginx 停止/重启 [root@localhost ~]# /usr/local/nginx/sbin/nginx -s stop(quit、reload) 命令帮助 [root@localhost ~]# /usr/local/nginx/sbin/nginx -h 验证配置文件 [root@localhost ~]# /usr/local/nginx/sbin/nginx -t 配置文件 [root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf本文转载自https://www.cnblogs.com/taiyonghai/p/6728707.html
2018年12月29日
812 阅读
0 评论
0 点赞
2018-12-28
linux常用指令备忘
为node全局包(如:cnpm创建环境变量)$ sudo ln -s /usr/local/nodejs/bin/cnpm /usr/local/bin/ // 假设nodejs的安装目录为/usr/local/nodejs停止node服务ps -ef|grep node 找到node服务的进程信息root 3370 2822 0 16:21 pts/0 00:00:00 grep nodekill 3370 终止进程node后台启动nohup npm start& 通过这种方式启动,会在项目根目录生成nohup.out文件(如果本来不存在)并且跳出服务监控,服务的日志文件会写到nohup.out文件中forever工具,通过npm install -g forever安装。使用方法参考 https://www.npmjs.com/package/forever[1]: https://www.npmjs.com/package/forever
2018年12月28日
925 阅读
0 评论
0 点赞
2018-12-24
vue低版本浏览器兼容性(20181224更新)
promise在低版本浏览器需要通过pollyfill处理不同浏览器对promise解析的差问题,处理方法为,在main.js里加入如下代码import promise from 'es6-promise'; promise.polyfill();webpack中的babel处理的目录是在webpack.base.conf.js中通过includes配置的,默认没有包含node_modules下的库文件,某些npm包没有做es6新语法的处理,我们的webpack又没有编译这部分文件,就会报错,最常见的就是let,const,因为很多浏览器都已经支持let,const,但是低版本浏览器不支持,所以我们需要在include中加上这些没处理的包,处理方法为:在includes中加上对应的node_modules包的目录名,切记不要直接加入node_modules,因为有些npm包不能通过webpack编译,而且也太了。build里面的webpack.base.conf.js的module中配置{ test: /\.js$/, loader: 'babel-loader', include: [ resolve('src'), resolve('test'), resolve('node_modules/_swiper@4.4.6@swiper'), resolve('node_modules/_dom7@2.1.2@dom7'), resolve('node_modules/webpack-dev-server/client' )] }
2018年12月24日
888 阅读
0 评论
0 点赞
2018-12-15
react学习笔记之react-router4.x中JS路由跳转
在react开发单页应用的时候,有时我们需要通过js触发路由的跳转而不是紧紧通过Link组件链接跳转。如:登录成功自动跳转到网站首页或者redirect页;在ajax请求中,通过公共方法验证登录token是否有效,如果无效跳转到登录页等等。针对上面的两种情况,就有两种路由跳转场景,第一种:在中间中触发路由跳转,第二种:在非Component组件的js中触发路由跳转,这两种场景的跳转方法分别为:一,组件中跳转到另一个路由组件:从react-router-dom中导入withRouter方法import { withRouter } from 'react-router-dom';使用withRouter方法加工需要触发路由跳转的组件export default withRouter(Login);通过withRouter加工后的组件会多出一个history props,这时就可以通过history的push方法跳转路由了。this.props.history.push('/home');二,非组件JS函数中触发路由跳转从history中导入createHashHistory方法(如果您的react应用使用的是history路由则导入createBrowserHistory)import { createHashHistory } from 'history'; // 如果是hash路由 import { createBrowserHistory } from 'history'; // 如果是history路由React-Router v4.0上已经不推荐使用hashRouter,主推browserRouter,但是因为使用browserRouter需要服务端配合可能造成不便,有时还是需要用到hashRouter。创建history实例const history = createHashHistory();跳转路由history.push('/login');
2018年12月15日
1,108 阅读
0 评论
0 点赞
2018-11-01
Mac电脑下查看某文件或者目下下的文件的代码行数工具(cloc)
1,通过homebrew安装cloc(若您的mac没有安装home_brew需要先安装home_brew,安装方法参考Homebrew安装)在Terminal中输入:brew install cloc 回车等待安装完成2,检查cloc是否安装成功在Terminal中输入:cloc -help 回车如果能打出一长串帮助文档,那就证明安装成功了3,使用在任意目录下 执行命令 cloc ./ 即可检测当前目录的所有文件的代码行数。查看其它目录,后面的路径按照以前的目录规则匹配即可,如果具体到某一文件的名称,则检测某一文件的代码行数。排除当前目录下的某个文件夹的代码,比较常见的是排除libs中的代码,因为libs中的一般为第三方库,所以这里以libs文件夹为例:cloc ./ --exclude-dir=libs检测结果如下图上面统计的是vue项目下的src目录下的代码行数,可以看到,cloc是可以统计vue组件文件的。4,其它用法查看cloc文档或者执行命令cloc -help查看帮助文档了解所有命令
2018年11月01日
1,495 阅读
0 评论
0 点赞
2018-10-30
小程序中生成二维码和条形码
使用wxbarcode模块可以很方便地生成二维码和条形码。效果安装$ npm install wxbarcode使用方法import wxbarcode from 'wxbarcode' wxbarcode.barcode('barcode', '1234567890123456789', 680, 200); wxbarcode.qrcode('qrcode', '1234567890123456789', 420, 420);条形码函数名:barcode函数原型:barcode(id, code, width, height)参数:id: wxml文件中的 Canvas IDcode: 用于生成条形码的字符串width: 生成的条形码宽度,单位 rpxheight: 生成的条形码高度,单位 rpx二维码函数名:qrcode函数原型:qrcode(id, code, width, height)参数:id: wxml文件中的 Canvas IDcode: 用于生成二维码的字符串width: 生成的二维码宽度,单位 rpxheight: 生成的二维码高度,单位 rpx小程序案例// 页面所在的js文件 import wxbarcode from '../../utils/qrcode/index.js'; // ... wxbarcode.barcode('barcode', res.data.voucher_info.closure_code, 680, 150); wxbarcode.qrcode('qrcode', res.data.voucher_info.closure_code, 340, 340);// wxml文件 <view class='barcode'> <canvas canvas-id="barcode"></canvas> </view> <view class='qrcode'> <!-- <image src='/assets/images/qrcode.png'></image> --> <canvas canvas-id="qrcode"></canvas> </view>本地wxbarcode目录结构(从github download下来的目录结构)
2018年10月30日
1,503 阅读
0 评论
0 点赞
2018-10-24
HTML特殊字符编码对照表
HTML特殊字符编码对照表 特殊符号 命名实体 十进制编码 特殊符号 命名实体 十进制编码 特殊符号 命名实体 十进制编码 Α Α Α Β Β Β Γ Γ Γ Δ Δ Δ Ε Ε Ε Ζ Ζ Ζ ΗΗ Η Θ Θ Θ Ι Ι Ι Κ Κ Κ Λ Λ Λ Μ Μ Μ Ν Ν Ν Ξ Ξ Ξ Ο Ο Ο Π Π Π Ρ Ρ Ρ Σ Σ Σ Τ Τ Τ Υ Υ Υ Φ Φ Φ Χ Χ Χ Ψ Ψ Ψ Ω Ω Ω α α α β β β γ γ γ δ δ δ ε ε ε ζ ζ ζ η η η θ θ θ ι ι ι κ κ κ λ λ λ μ μ μ ν ν ν ξ ξ ξ ο ο ο π π π ρ ρ ρ ς ς ς σ σ σ τ τ τ υ υ υ φ φ φ χ χ χ ψ ψ ψ ω ω ω ϑ ϑ ϑ ϒ ϒ ϒ ϖ ϖ ϖ • • • … … … ′ ′ ′ ″ ″ ″ ‾ ‾ ‾ ⁄ ⁄ ⁄ ℘ ℘ ℘ ℑ ℑ ℑ ℜ ℜ ℜ ™ ™ ™ ℵ ℵ ℵ ← ← ← ↑ ↑ ↑ → → → ↓ ↓ ↓ ↔ ↔ ↔ ↵ ↵ ↵ ⇐ ⇐ ⇐ ⇑ ⇑ ⇑ ⇒ ⇒ ⇒ ⇓ ⇓ ⇓ ⇔ ⇔ ⇔ ∀ ∀ ∀ ∂ ∂ ∂ ∃ ∃ ∃ ∅ ∅ ∅ ∇ ∇ ∇ ∈ ∈ ∈ ∉ ∉ ∉ ∋ ∋ ∋ ∏ ∏ ∏ ∑ ∑ − − − − ∗ ∗ ∗ √ √ √ ∝ ∝ ∝ ∞ ∞ ∞ ∠ ∠ ∠ ∧ ∧ ⊥ ∨ ∨ ⊦ ∩ ∩ ∩ ∪ ∪ ∪ ∫ ∫ ∫ ∴ ∴ ∴ ∼ ∼ ∼ ≅ ≅ ≅ ≈ ≈ ≅ ≠ ≠ ≠ ≡ ≡ ≡ ≤ ≤ ≤ ≥ ≥ ≥ ⊂ ⊂ ⊂ ⊃ ⊃ ⊃ ⊄ ⊄ ⊄ ⊆ ⊆ ⊆ ⊇ ⊇ ⊇ ⊕ ⊕ ⊕ ⊗ ⊗ ⊗ ⊥ ⊥ ⊥ ⋅ ⋅ ⋅ ⌈ ⌈ ⌈ ⌉ ⌉ ⌉ ⌊ ⌊ ⌊ ⌋ ⌋ ⌋ ◊ ◊ ◊ ♠ ♠ ♠ ♣ ♣ ♣ ♥ ♥ ♥ ♦ ♦ ♦   ¡ ¡ ¡ ¢ ¢ ¢ £ £ £ ¤ ¤ ¤ ¥ ¥ ¥ ¦ ¦ ¦ § § § ¨ ¨ ¨ © © © ª ª ª « « « ¬ ¬ ¬ ­ ­ ® ® ® ¯ ¯ ¯ ° ° ° ± ± ± ² ² ² ³ ³ ³ ´ ´ ´ µ µ µ " " " < < < > > > ' '
2018年10月24日
1,024 阅读
0 评论
0 点赞
2018-09-30
很久以前写的jquery鼠标悬停效果插件
很久以前自己写的一个jquery鼠标悬停效果插件,兼容所有浏览器,内部主要包括了jquery插件的开发方式,插件参数的处理等,可以作为jquery插件开发的参考对象下载地址 http://www.jq22.com/jquery-info6621
2018年09月30日
835 阅读
0 评论
0 点赞
1
...
8
9
10
11