会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
old-man
博客园
首页
新随笔
联系
订阅
管理
2020年4月28日
地址栏url获取并处理
摘要: 作为一个前端,组件之间的传值是必不可少的,当然有好多种方式,这分享一种通过url路径通过传参的方式来进行组件之间的传值 例如:https://www.baidu.com/s?wd=博客园&code='1' 这个例子中wd和code作为参数来携带值去跳转里一个页面,而在另一个页面去获取就可以了。当然一
阅读全文
posted @ 2020-04-28 16:43 old-man
阅读(452)
评论(0)
推荐(0)
2020年4月26日
ECharts自定义提示框
摘要: tooltip: { trigger: 'axis', position: function (position) { return [position[0], position[1]] }, formatter: '{a0}:{c0}元' + '<br>' + '日期:{b0}' }, 背景底色设
阅读全文
posted @ 2020-04-26 16:09 old-man
阅读(579)
评论(0)
推荐(0)
2019年11月19日
判断浏览器类型、语言、微信、页面首次加载等
摘要: 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
阅读(472)
评论(0)
推荐(0)
2019年11月5日
移动端和pc端判断
摘要: 正则的方式 if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ // console.log("移动端") } else { // console.log("pc端") }
阅读全文
posted @ 2019-11-05 19:54 old-man
阅读(304)
评论(0)
推荐(0)
2019年10月15日
pc端适配移动端
摘要: 废话不多说了,心里难受 在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
阅读(655)
评论(0)
推荐(0)
2019年7月25日
webpack的配置以及使用
摘要: 新建一个文件 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
阅读(284)
评论(0)
推荐(0)
2019年7月18日
token使用原理及使用
摘要: token的使用原理 token的使用: 安装jsonwebtoken: cnpm install jsonwebtoken -S 引入jsonwebtoken: const jwt = require("jsonwebtoken"); 密码验证以后进行操作生成token: let token =
阅读全文
posted @ 2019-07-18 16:16 old-man
阅读(3732)
评论(0)
推荐(0)
2019年7月17日
node连接mongoose并对数据库进行操作
摘要: 初始化项目: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
阅读(1588)
评论(0)
推荐(0)
2019年7月16日
node连接mongodb并在对数据进行增删改查
摘要: 先在全局终端启动服务: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
阅读(433)
评论(0)
推荐(0)
on、off、emit的简单封装
摘要: 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
阅读(304)
评论(0)
推荐(0)
下一页
公告