- 博客(18)
- 收藏
- 关注
原创 手写 call, apply , bind
使用:var year = 2020 obj = { year: 2021 } const getDate = function (month, day) { return `${this.year}-${month}-${day}` } console.log(getDate.call(null, 3, 1)) // 2020-3-1 console.log(getDate.call(obj, 5, 2))
2021-06-10 11:43:05
164
原创 vue activited 无效问题
vue 中的 activited 不生效 问题由于一些请求数据的接口 页面切换的时候需要用到,就写在了activited中,但发现无论怎么样,activited 就是不生效,vue 文件 的name 属性加了,keepAlive: true 加了 也加了还是无效。最后找到解决办法:keep-alive 必须加在组件直接关联的 router-view 上!我出现的问题是由于 标签加在了 #app 的 div 里,需要加在组件直接关联的 router-view 上...
2020-10-09 18:03:53
2028
原创 开发中遇到的报错
1、使用 Element-ui 的导航,重复点击一个导航,遇到一个错误,报错信息如下:Uncaught (in promise) Error: Avoided redundant navigation to current location: "/xxx/xxx/xxx"(看网上说的是:vue-router 3.0 以上会出现这个报错)解决方法如下:在项目路由配置文件里面加上如下代码:Router.prototype.push = function push(location) { ret
2020-09-27 14:18:14
1847
原创 开发小工具
判断给定两个日期之间的间隔天数,是否超过某短时间/** * 判断两个时间之间是否超过给定天数 * @param: date1 { string|date }, yyyy-MM-dd 要判断的时间 * @param: date2 { string|date }, yyyy-MM-dd 要判断的时间 * @param: limit { number }, 给定的天数 * */ isOutPass (firstDate,
2020-09-24 17:53:48
187
原创 使用 Element-ui 的导航,重复点击相同的导航,报错。
使用 Element-ui 的导航,重复点击一个导航,报错信息如下:Uncaught (in promise) Error: Avoided redundant navigation to current location: "/xxx/xxx/xxx"(看网上说的是:vue-router 3.0 以上会出现这个报错)解决方法如下:在项目路由配置文件里面加上如下代码:Router.prototype.push = function push(location) { return Route
2020-09-07 11:56:19
531
原创 Mac安装home-brew步骤
官网的方法不再赘述按照官网的方法我没安装上,以下是我自己在网上找的方法,分享出来。首先下载brew_install文件,(这个可以在网上找到)修改其中的一行代码:#BREW_REPO = "https://github.com/Homebrew/brew".freezeBREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freeze然后打开终端执行:/usr/bin/ruby 这里跟上你刚才修改好的brew_install 文件路径然后空格
2020-05-25 13:26:38
833
原创 排序算法总结
所有排序都是以 从小到大 为例冒泡排序思路:1、从数组第一个开始,与后面的一个元素比较。2、如果前一个大于后一个,则交换位置。否则位置不变,下标加一代码实现: let a = [1,2,3,4,6,2,4,6,3,3,62,53,42,63,2,5,34]; function maopao(arr){ for(let i = 0; i < arr.len...
2020-04-15 22:04:50
118
原创 三栏布局
三栏布局说明:左右定宽,中间自适应宽度方法一 : 利用 calccss<style> body{ font-size: 0; } .one { display: inline-block; width: 100px; height: 2...
2020-03-19 18:24:58
139
原创 一个div 实现太极八卦图
css <style> .aaa{ width: 100px; height: 200px; background-color: #ffffff; position: absolute; top: 0; left: 0; ...
2020-03-19 17:53:53
318
原创 Vue 响应式原理的理解
一句话总结:Vue 内部代理了 data 的数据,利用 Object.defineProperty 方法,对 data 中数据进行 getter 和 setter ,然后在进行 render;
2020-03-17 21:51:51
176
转载 解决 安装不上 node-sass 问题
产生以下报错:Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-72_binding.node": connect ETIMEDOUT 52.217.13.36:443解决方法:执行命令npm i node-sass --sass_binary_site=https...
2020-02-10 14:54:40
395
原创 常用 loader 集锦
做项目的时候不知道加载文件需要那个 loader , 在网上找了很长时间,这个相对全一点,记录下来。1.模板:(1)html-loader:将HTML文件导出编译为字符串,可供js识别的其中一个模块(2)pug-loader : 加载pug模板(3)jade-loader : 加载jade模板(是pug的前身,由于商标问题改名为pug)(4)ejs-loader : 加载ejs模板(5...
2020-01-03 19:55:35
1578
1
原创 vue 新项目报错:[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not
vue.js 新建项目报错[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included...
2019-12-30 18:28:33
729
原创 vue 项目中引入Element-UI报错问题
vue 项目中引入 Element-UI 之后 报错解决方法刚开始引入 Element-UI 的时候 , 运行 nom run dev 报以下错误:ERROR in ./node_modules/element-ui/lib/theme-chalk/fonts/element-icons.ttfModule parse failed: Unexpected character '' (1:0...
2019-08-28 14:04:56
2622
原创 webpack打包vue文件报错:ERROR in ./src/App.vue 1:0 Module parse failed: Unexpected token (1:0) You may need
webpack默认不能处理vue文件,只能自己添加额外的插件进行处理解决报错如下:安装两个拓展插件npm i vue-loader vue-template-compiler -D 然后在webpack.config.js添加如下配置: module: { rules: [ { test:/\.vue$/, loader: 'vue-loader...
2019-04-10 17:27:26
12975
11
原创 MongoDB 安装 4.0.6版本 windows服务无法启动(报错1053)
MongoDB 安装 4.0.6版本 windows服务无法启动(报错1053)打开服务面板,找到MongoDB服务右键点击,选择属性选择登陆更改为“本地系统账户”应用,确定即可。...
2019-03-13 20:58:44
870
8
原创 PHP连接Mysql和一些基本操作
建立数据库连接$conn = mysqli_connect('localhost','账号','密码','数据库名称'); if (!$conn) { exit('<h1>连接失败</h1>'); //连接失败之后退出 }查询语句$query = mysqli_query($conn(刚刚获取的连接),'SQL查询语句'); if (!$...
2018-12-11 19:23:58
149
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人