摘要: 作为一个前端,组件之间的传值是必不可少的,当然有好多种方式,这分享一种通过url路径通过传参的方式来进行组件之间的传值 例如:https://www.baidu.com/s?wd=博客园&code='1' 这个例子中wd和code作为参数来携带值去跳转里一个页面,而在另一个页面去获取就可以了。当然一 阅读全文
posted @ 2020-04-28 16:43 old-man 阅读(440) 评论(0) 推荐(0) 编辑
摘要: tooltip: { trigger: 'axis', position: function (position) { return [position[0], position[1]] }, formatter: '{a0}:{c0}元' + '<br>' + '日期:{b0}' }, 背景底色设 阅读全文
posted @ 2020-04-26 16:09 old-man 阅读(567) 评论(0) 推荐(0) 编辑
摘要: 1、检查是否是移动端(Mobile)、ipad、iphone、微信、QQ等 //判断访问终端 var browser={ versions:function(){ var u = navigator.userAgent return { trident: u.indexOf('Trident') > 阅读全文
posted @ 2019-11-19 12:57 old-man 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 正则的方式 if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ // console.log("移动端") } else { // console.log("pc端") } 阅读全文
posted @ 2019-11-05 19:54 old-man 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 废话不多说了,心里难受 在html页面头部加上 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"> content属性值 : width:可视区域的宽度,值可为数字或关键词devic 阅读全文
posted @ 2019-10-15 12:28 old-man 阅读(648) 评论(0) 推荐(0) 编辑
摘要: 新建一个文件 1.初始化项目 cnpm init -y 2.安装webpack cnpm install webpack webpack-cli -D 3.在新建的文件夹下面新建一个src文件夹 4.在新建的文件下面创建一个webpack.config.js文件,在该文件里面进行webpack的配置 阅读全文
posted @ 2019-07-25 21:16 old-man 阅读(274) 评论(0) 推荐(0) 编辑
摘要: token的使用原理 token的使用: 安装jsonwebtoken: cnpm install jsonwebtoken -S 引入jsonwebtoken: const jwt = require("jsonwebtoken"); 密码验证以后进行操作生成token: let token = 阅读全文
posted @ 2019-07-18 16:16 old-man 阅读(3687) 评论(0) 推荐(0) 编辑
摘要: 初始化项目:cnpm init -y 局部安装mongoose:cnpm install mongoose -S 打开服务:mongod --dbpath d:\data\db const mongoose = require("mongoose"); const data_url = "mongo 阅读全文
posted @ 2019-07-17 08:14 old-man 阅读(1576) 评论(0) 推荐(0) 编辑
摘要: 先在全局终端启动服务:mongod --dbpath d:\data\db; 在操作文件夹下打来初始化项目:cmd:cnpm init -y 在操作文件夹下安装MongoDB:cnpm install Mongodb -S 在编辑器开始编写: const mongoClient = require( 阅读全文
posted @ 2019-07-16 17:59 old-man 阅读(426) 评论(0) 推荐(0) 编辑
摘要: on的封装: 思路: 1.判断事件名称是否存在。 2.如果存在的情况下将cb存放在eventName这个数组中。 3.如果不存在创建Key值为eventName,val为数组。 const $on=(eventName,cb)=>{ if(!eventList[eventName]){ eventL 阅读全文
posted @ 2019-07-16 10:51 old-man 阅读(279) 评论(0) 推荐(0) 编辑