js
Auroral_Su
这个作者很懒,什么都没留下…
展开
-
微信 IOS系统 安卓时间格式
下面用正则替换2018-08-30日期格式为2018-08-30后问题解决time.replace(/-/g, ‘/’);原创 2021-11-30 14:30:39 · 1570 阅读 · 0 评论 -
uniapp中使用vue 关于全局定义
1. 全局组件定义import hgIndexNav from '@/components/hg-index-nav/hg-index-nav.vue';Vue.component('hgIndexNav',hgIndexNav)1. 全局方法定义import utils from '@/utils/util.js'Vue.mixin({ methods: { getMiUnit(number){ return utils.getMiUnit(number) } }})原创 2021-11-16 10:10:13 · 554 阅读 · 0 评论 -
监听storage改变
storage事件中的坑,storage.setItem()无法触发storage事件一、概述众所周知,以下代码可以用来监听页面中localstorage和sessionstorage中属性值的变化1window.addEventListener(‘storage’, event=>{})二、预期假如我们打开一个页面a.html,内有如下代码window.addEventListener(‘storage’, e=>{console.log(e)})我们在当前标签页控制台输入如下原创 2021-09-28 14:18:44 · 1231 阅读 · 1 评论 -
跳转新界面
window.open(https://baidu.com,‘newwindow’,‘toolbar=no,menubar=no, scrollbars=no, resizable=no,location=no, status=no’);#nav{display: none!important;}[data-name=“global”] {top: 0!important;}样式通过jsdocument.getElementById(“nav”).style.display = ‘none’原创 2021-09-26 15:58:15 · 104 阅读 · 0 评论 -
js函数
函数声明和函数表达式的区别1. 函数声明1)函数声明(Function Declaration); // 函数声明 function funDeclaration(type){ return type==="Declaration"; }会被提升使用2.函数表达式2)函数表达式(Function Expression) // 函数表达式 var funExpression = function(type){ return type==原创 2020-09-01 16:37:20 · 85 阅读 · 0 评论