WishMeLz

生活其实很有趣

Wish 发布的文章

Vue双向绑定原理

利用Object.defineProperty() 这个方法重新定义了对象获取属性值(get)和设置属性值(set)的操作来实现在Vue3.0中使用Proxy替换Object.definePropertyObject.defineProperty 无法监控到数组下标的变化,导致直接通过数组的下标给数组设置值,不能实时响应Object.defineProperty只能劫持对象的属性,需要每个属性每个对象进行遍历。在2.x中,是通过递归和遍历data对象来实现数据监控。如果能直接劫持一个完整的对象更好Proxy可以劫持整个对象,但是Proxy是ES6的...

Vue监听器

watch:{ // 参数一:修改后的值; // 参数二:修改之前的值 参数名字:function(newValue,oldValue){ // 操作 } }比如监听每次跳转的路由watch:{ $route(to,from){ console.log(to.path); } }, OR watch: { $route: { handler: function(val, oldVal){ console.log(val); }, // 深度观察监听 ...

npm制作属于自己的组件库

1.组件位置( /packages )遵守一个组件一个文件夹规则目录结构如下组件内的index是按需引入。packages内的index是全部引入。各个文件代码如下:/packages/cad/src/main.vue <template> <div> 这里是一个组件 </div> </template> <script> export default { name:"Cad" } </script> ==================================== /p...

Mac代码

密码限制 pwpolicy -clearaccountpolicies查看容量大小 du -sh *

iptables

iptables -I INPUT -p tcp --dport 3306 -m state --state NEW -j ACCEPT

nuxt笔记

1.Axios设置基地址 // nuxt.config.js axios: { baseURL: 'xxxx' } 拦截器 ~/plugins/axios.js export default function({$axios}){ $axios.onRequest(config => { //请求前 }) $axios.onResponse(response => { // 请求后 }) $axios.onError(erro...

easy-mock

安装Redis$ wget http://download.redis.io/releases/redis-4.0.14.tar.gz$ tar xvzf redis-stable.tar.gz$ yum -y install gcc$ cd redis-4.0.14/$ make // error make MALLOC=libc$ cp src/redis-server /usr/local/bin/$ cp src/redis-cli /usr/local/bin/$ vi redis.conf 修改daemonize=no为yes$ r...

一门APP --打包手机软件神器

Hbuilder打包web端出现了较多的问题。路由问题,以及其他跳转问题。还有使用Fusion APP打包web端网站也有着较多的问题。然后发现了一个打包HTML或者封装url网址的工具。一门APP一般VUE开发移动端,直接在网站上线。然后使用一门打包这个http网址。简单设置名称和网站地址设计软件图标,切图还有其他的API可以配置,有免费也有收费的。

Hbuilder

1.打包web页面创建5+app项目,将打包的静态项目拷贝进项目。云打包。2.打包ULRL创建WAP2APP项目

Nginx反向代理

server { listen 80; server_name xxx.com; location / { proxy_pass http://xxx.cn/; proxy_redirect default; } }根据端口和 server_name 反向代理。如果都不匹配默认第一个server使用以上配置之后,虽然能够访问到转发后的地址,但是所有静态资源文件的请求都报404错误,导致反向代理并没有完全成功。出于nginx的路由路径【/yan...

Nginx 负载均衡

轮询: upstream dalaoyang-server { server localhost:11000; server localhost:11001; server localhost:11002; }权重: upstream dalaoyang-server { server localhost:10001 weight=1; server localhost:10002 weight=2; }worker_process...

压力测试

1.Webbench wget http://home.tiscali.cz/cz210552/distfiles/webbench-1.5.tar.gz 或者:http://itsse.oss-cn-shanghai.aliyuncs.com/files/1591677875011.gz tar xvzf webbench-1.5.tar.gz make 如果error: mkdir -p /usr/local/man    chmod 644 /usr/local/man make install webbench // we...

Vue项目打包

1.打包优化 --report npm run build --report 两个-// 根目录创建vue.config.js module.exports = { configureWebpack: { externals: { vue: "Vue", "vue-router": "VueRouter", vant: "vant" } } }; 2.页面刷新404// experss 操作 var history = require('connect-history-api-fal...

Vue移动端隐藏滚动条

html, body { width: 100%; height: 100%; overflow: scroll; } html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0px; height: 0px; } body { margin: 0; }

Nodejs express搭建https服务

阿里云申请ssl证书。下载证书 就出现两个文件 .key与.pem文件var fs = require('fs'); var http = require('http'); var https = require('https'); var privateKey = fs.readFileSync('./path/**.key', 'utf8'); var certificate = fs.readFileSync('./path/**.pem', 'utf8'); var credentials = {key: privateKey, cert...

Yum

yum history list 查看操作历史yum history undo id   卸载

BBR

bbr Plus wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh https://cdn.jsdelivr.net/gh/WishMelz/file/sh/bbr1.shUbuntu内核升级以及如何开启BBR加速1.) Ubuntu开启BBR的前提是内核必须等于高于4.9 查看命令...

charles for mac

// 适用于Charles任意版本的注册码 // help---> register Registered Name: https://zhile.io License Key: 48891cf209c6d32bf4 文章原链: https://zhile.io/2017/07/07/charles-proxy-usage-and-license.html