
个人
mi_cy
这个作者很懒,什么都没留下…
展开
-
卸载重装mac vscode
1、退出vscode2、删除配置文件sudo rm -rf $HOME/Library/Application\ Support/Code// if you're using insider*sudo rm -rf $HOME/Library/Application\ Support/Code\ -\ Insiders/3、删除扩展插件sudo rm -rf $HOME/.vscode// if you're using insider*sudo rm -rf $HOME/.vscode-i原创 2022-02-08 10:16:54 · 2478 阅读 · 0 评论 -
设置浏览器Cookie Doman
需求: 根据当前域名,将当前域名的二级域名设置为Doman 。 而不是全部域名const spli = window.location.host.split('.')// 获取到二级域名const host = '.' + spli[1] + '.' + spli[2]// 设置Cookiesdocument.cookie = 'token=' + response.body.token + `; domain=${host}; expires=` + d.toUTCString() + '; p原创 2022-02-07 14:15:43 · 511 阅读 · 0 评论 -
一维数组通过PID ID 转多维数组
data() { return { arr: [ { id: 1, name: '部门1', pid: 0 }, { id: 2, name: '部门2', pid: 1 }, { id: 3, name: '部门3', pid..原创 2021-07-15 15:04:57 · 368 阅读 · 0 评论 -
Sequelize 表关联
一对一: belongsTo一对多: hasMany Adbook.associate = function () { // 一对多 { foreignKey: 别的表 '使用什么字段关联'。 targetKey (自己表) ‘只能对自己表ID 参数’} app.model.Adbook.hasMany(app.model.Adswiper, { as: 'swiperlist', foreignKey: 'mid' }) /**原创 2021-07-05 18:06:21 · 468 阅读 · 0 评论 -
二维数组转一维
const arr=[[1,2,3],[3,4],[5]]; console.log([].concat.apply([],arr));原创 2021-04-02 16:41:45 · 233 阅读 · 0 评论 -
egg 端口问题
端口被用了Mac : sudo lsof -i :(端口号) 查找PID sudo kill -9 (PID)原创 2021-02-22 19:33:28 · 509 阅读 · 0 评论 -
egg:ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server;
//chen1995 本地 mysql 密码ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'chen1995';原创 2021-02-20 10:57:23 · 297 阅读 · 0 评论 -
服务器拷贝
cp -rf .nuxt new_file原创 2020-12-31 09:40:24 · 264 阅读 · 0 评论 -
vscode提示‘Vetur find `tsconfig.json`/`jsconfig.json`, but they aren‘t in the project root.’
#1 问题1、vetur0.31.0,无法格式化.vue文件2020-12-10 已经发布了 0.31.1 版本(Fix Vetur can’t format),安装新版即可(如果不会安装插件的固定版本,请看最后)。#2 Vetur find tsconfig.json/jsconfig.json, but they aren’t in the project root.0.31.0版本新增了一个vetur.config.js的配置文件,在这个版本之后,会优先查找项目中是否配有tsconfig.j原创 2020-12-11 11:17:07 · 15319 阅读 · 9 评论 -
vscode. setting配置
vscode. setting配置{ "workbench.sideBar.location": "right", "workbench.iconTheme": "simple-icons", "workbench.colorTheme": "One Dark Pro", "eslint.options": { "extensions": [".js", ".vue", ".ts", ".tsx"] }, "eslint.validate": [ "javascri原创 2020-12-09 15:32:11 · 1784 阅读 · 0 评论 -
服务器安装了nvm但是无法使用
主目录输入这个命令source .nvm/nvm.sh原创 2020-11-17 11:00:49 · 446 阅读 · 0 评论 -
vue项目,代码部署之后,如何解决浏览器存在缓存问题
<meta http-equiv="pragram" content="no-cache"><meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">在nginx.conf页面添加如下代码:location = /index.html { add_header Cache-Control "no-cache, no-store";}在开发中使用sessionSt原创 2020-10-24 13:15:01 · 3659 阅读 · 1 评论 -
vue Store 用法
直接获取值 Computed:{ ...mapState([ 'userInfo', 'currentLevelData', 'currentScriptData' ]), } 方法 methods:{ ...mapMutations(['SET_MESSAGE']), ...mapActions([ 'getLevelData', 'clearScriptData' ]), }原创 2020-10-23 11:41:06 · 374 阅读 · 0 评论 -
查询id_rsa.pub
cd ~/.ssh/原创 2020-09-22 11:30:35 · 1147 阅读 · 0 评论 -
el-cascader省市区 三级数据
export default { areajson: [ { value: '110000', label: '北京', children: [ { value: '110100', label: '北京市', children: [ { value: '110101', label: '东城区' }, { value: '110102'原创 2020-09-15 10:13:50 · 1336 阅读 · 1 评论 -
el-cascader 省市数据
//直接定义city.jsconst options = [ { "value": "北京市", "label": "北京市", "children": [ { "value": "市辖区", "label": "市辖区", }] }, { "value": "天津市", "label": "天津市", "children": [ { "value": "市辖区",原创 2020-09-15 09:53:03 · 1840 阅读 · 0 评论 -
设置一个活动倒计时
需求: 写一个活动倒计时功能获取当前时间戳const current_time = Math.round(new Date().getTime() / 1000).toString()大概过程后台会返回一个活动开始时间的时间戳,你需要把活动时间戳减去当前时间戳, 再将剩下的转换为时分秒初始化的时候 定义一个定时器 clearInterval(this.newTimer) this.newTimer = setInterval(this.CountDown, 1000)method原创 2020-09-11 15:37:52 · 466 阅读 · 0 评论 -
图片上传压缩 --el-upload 封装图片上传
个人谈谈upload 组件 最简单的头像上传功能,直接使用 :action 上传即可 但是涉及到需要携带其他的数据时, 需要使用formdata 数据格式 1. 直接上传file 文件让后端进行操作 2. 前端将图片 转为base64 编码。 后端对base64 进行操作个人理解 通过action 上传, 后端返回图片在线地址或者base64 编码。 前端展示 <el-form-item label="头像"> <el-upload class="avat原创 2020-09-08 21:54:59 · 1063 阅读 · 0 评论 -
字符串转数组
let arrString= '["陕西省", "西安市", "高新区"]'let objArray = eval("(" + arrString + ")" )console.log(objArray ) // ["陕西省", "西安市", "高新区"]let arrString= '["陕西省", "西安市", "高新区"]'let objArray = eval(arrString)console.log(objArray) // ["陕西省", "西安市", "高新区"..原创 2020-09-08 09:53:59 · 4979 阅读 · 0 评论 -
图片获取base地址
beforeAvatarUpload(file) { let reader = new FileReader() reader.readAsDataURL(file) let img var that = this reader.onloadend = function() { img = reader.result } }原创 2020-08-24 16:25:46 · 867 阅读 · 0 评论 -
.prettierrc.json
{ "semi": false, "singleQuote": true, "bracketSpacing": true}原创 2020-07-29 17:04:01 · 1289 阅读 · 0 评论 -
sort排序
//数据背景 填空题存在多个空/*** * sort 值为第几个空 1 为第一个空 , * da 标准答案 * fen 标准答案对应的分数 * * 想要的数据格式 * 数组里面包含多个对象, 第一个对象默认就是第一个空, 第二个对象默认就是第二个空 * 然后10: 100 就是 答案:分数 */// [// {// 10:100,// 20:200// },// {// 30:300// },// {// ..原创 2020-07-27 15:09:59 · 149 阅读 · 0 评论 -
一个新服务器操作
1.初始化 sudo apt update 2.安装node --方法未知 # apt-get update # apt-get install -y python-software-properties software-properties-common # add-apt-repository ppa:chris-lea/node.js # apt-get update # apt-get install nodejs 3.node -安装最新版本的node curl -sL .原创 2020-07-01 15:01:06 · 240 阅读 · 0 评论 -
代码回滚退清除记录
代码回滚-退git reset --hard HEAD^ 回退到上个版本清除记录git push --force原创 2020-06-24 10:13:21 · 308 阅读 · 0 评论 -
koa2+sequelize
定义sequelize.js 其中../conf/index 是你的配置文件const Sequelize = require('sequelize');const config = require('../conf/index');exports.sequelize = function () { return new Sequelize( config.mysql.database, config.mysql.user, config.原创 2020-06-22 11:46:58 · 536 阅读 · 0 评论 -
快速理解npm install时--save和--save-dev的区别
dependencies和devDependencies在使用node开发时, 我们在工程中用到的包必须是package.json中列出。而dependencies和devDependencies是package.json中的两个属性. 我们要用的包在这两个属性中列出即可.dependencies列出的包用于生产环境.devDependencies用于开发环境和测试环境.- -save和- -save-dev在安装包时, 我们可以根据环境决定包的安装效果. 假设我们要安装express1.原创 2020-06-17 21:29:40 · 390 阅读 · 0 评论 -
mac node版本nvm切换
安装nvmcurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash或者wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash 命令:nvm ls-remote:列出所有可以安装的node版本号nvm install v10.4.0:安装指定版本号的nodenvm原创 2020-06-10 10:01:29 · 903 阅读 · 0 评论 -
Linux| MacOs下载配置Mongo
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.2.tgztar -zxvf mongodb-linux-x86_64-3.6.2.tgzmv mongodb-linux-x86_64-3.6.2.tgz/ /usr/local/mongodbcd /usr/local/mongodbmkdir datamkdir data/dbmkdir data/logscd bin//usr/local/mongodb/bi原创 2020-06-04 21:16:06 · 237 阅读 · 0 评论 -
mac mongo操作
1. 下载mongo 默认安装/usr/local/2. 我对安装地址 /usr/local/mongodb/bin 3. 链接数据库在bin目录下 --- sudo ./mongod --dbpath /Users/murp/Desktop/wx/smallprogram4. 启动数据库在bi目录下 -- sudo ./mongo恢复数据我对原始下载下来对数据在桌面BaseData ,然后现在 想要恢复到 桌面Wx的smallprogram 文件夹中 恢复原创 2020-05-26 15:11:28 · 237 阅读 · 0 评论 -
nuxt build在服务端部署
1. 本地build再上传,在.gitignore里把.nuxt去掉、并把dist改为/dist, .nuxt 加入 .npmignore (新建)2. 然后本地执行yarn build,成功之后再上传到github上,检查一下.nuxt是否有上传上去。3.通过nuxt build 打包之后生成.nuxt 文件夹 然后上传到服务器。 再将 .nuxt package.json state nuxt.config.js 新建一个目录。 4. 新建完成之后npm install 下载最后部署:原创 2020-05-22 16:04:57 · 1473 阅读 · 0 评论 -
正则匹配中文
[\u4e00-\u9fa5] //匹配中文字符要是还可能会出现英文字母或者数字的, /([\u4e00-\u9fa5|\w])+/g^[1-9]\d*$ //匹配正整数^[A-Za-z]+$ //匹配由26个英文字母组成的字符串^[A-Z]+$ //匹配由26个英文字母的大写组成的字符串^[a-z]+$ //匹配由26个英文字母的小写组成的字符串^[A-Za-z0-9]+$ //匹配由数字和26个英文字母组成的字符串...原创 2020-05-21 15:51:11 · 525 阅读 · 0 评论 -
css 元素自动撑满屏幕
top-值为 距离 上面的值。 一般 上面是有个header 我这个header 高度80 所以 top:80 position: absolute; width: 100%; top: 80px; left: 0; bottom: 0; background: #aaaaaa70;原创 2020-05-20 15:21:16 · 913 阅读 · 0 评论 -
elementui-button.css
.primary { display: inline-block; line-height: 1; white-space: nowrap; cursor: pointer; background: #fff; border: 1px solid #dcdfe6; -webkit-appearance: none; text-align: center; box-sizing: border-box; outline: none; margin: 0; t..原创 2020-05-15 17:45:10 · 411 阅读 · 0 评论 -
nuxt.vue router 兼容ie 11
Vue写法vue 写法new Vue({ el: '#app', router, store, template: '<Layout/>', components: { Layout }, render: function (createElement) { if ('-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.docume原创 2020-05-12 14:07:16 · 1108 阅读 · 0 评论 -
判断对象/数组是否为空
// this.$route.params 判断路由接收的参数是否为空对象 if (Object.keys(this.$route.params).length !== 0) { this.currentX = this.$route.params.idx; } else { this.currentX = 0; } },判断数组 if ( (this.$route.params).length !== 0) { this.curre原创 2020-05-12 10:57:12 · 1170 阅读 · 0 评论 -
node-gyp
请仔细看:https://github.com/nodejs/node-gyp#on-windows,我走的是第一个安装Visual C ++生成环境:Visual Studio生成工具 (使用“ Visual C ++ 生成工具”工作负载)官网上: 启动cmd, npm config set msvs_version 2017我的 :启动cmd, npm config set msvs_v...原创 2020-05-07 00:16:49 · 633 阅读 · 0 评论 -
elementui自定义头部render-header
https://cn.vuejs.org/v2/guide/render-function.html 官方api文档。。。参数配置-渲染函数大概效果就是增加模糊搜索。。然后列表展示。 这种是直接显示-----<el-table-column > <!-- 自定义表头 --> <template slot="header" slo...原创 2020-04-30 09:54:10 · 3577 阅读 · 0 评论 -
vue中vuex-i18n使用
先给个项目地址源码所在 json 文件:: https://github.com/Tom-cy/mi_njnpm i ~~npm install vuex-i18n使用 --我已经写好了jsimport Vue from "vue";import Vuex from 'vuex';// 国际化语言import vuexI18n from "vuex-i18n";// 引入语言文...原创 2020-04-28 11:11:59 · 2153 阅读 · 1 评论 -
Blockly.js
<!-- blockly.js 是自定义块!向外暴露一个 initBlock 函数 --><!-- let Blockly = vm.$blockly 获取Vue实例上的$blockly -->- 参数解析- this.appendDummyInput()- .appendField('String') 块的名称,描述块- .appen...原创 2020-04-26 14:48:14 · 861 阅读 · 0 评论 -
前端统计用户访问以及文章阅读
百度不蒜子统计工具有各种原生html 教程。我这边写一个关于vue 中使用的npm install busuanzi.pure.js --save 然后我已经将这个写成一个组件了。页面显示效果:关于数据问题: 这个统计的是localhost 所有的数据。所以才会这么多。你换成个人域名将不会,另外介绍下这个项目主要是关于vue 的。 里面有详细介绍vuex .mixin , c...原创 2020-04-24 11:53:29 · 1592 阅读 · 0 评论