摘要: left: 50%; top: 50%; transform: translate(-50%, -50%); position: absolute; /* 50%为自身尺寸的一半 */ position: absolute; left: 0; top: 0; right: 0; bottom: 0; 阅读全文
posted @ 2021-09-18 21:43 老运维 阅读(33) 评论(0) 推荐(0)
摘要: import { createStore } from 'vuex' const store = createStore({ state: { todos: [{ id: 1, text: '我是内容一', done: true }, { id: 2, text: '我是内容二', done: fa 阅读全文
posted @ 2021-09-16 17:04 老运维 阅读(69) 评论(0) 推荐(0)
摘要: 传统的导入导出 const sum=function (a,b){ return a+b; } module.exports={ sum } const m=require('./httpserver') console.log(m.sum(1,2)) es6 export function sum 阅读全文
posted @ 2021-09-01 19:56 老运维 阅读(20) 评论(0) 推荐(0)
摘要: //烟花特效 class Circle { constructor({origin, speed, color, angle, context}) { this.origin = origin this.position = {...this.origin} this.color = color t 阅读全文
posted @ 2021-09-01 18:23 老运维 阅读(183) 评论(0) 推荐(0)
摘要: 自带的循环,并且会把处理的值回填对应的位置 let arr=[1,2,3,4,5,6] let newarr=[]; for(let i=0;i<arr.length;i++){ newarr.push(arr[i]*2); } let newarr2=arr.map(function (ele){ 阅读全文
posted @ 2021-09-01 11:30 老运维 阅读(22) 评论(0) 推荐(0)
摘要: let info={ title:"0", link:"1" ,go:function (){ console.log("2"); } } var {name,address,...person2}=info; 阅读全文
posted @ 2021-09-01 11:28 老运维 阅读(34) 评论(0) 推荐(0)
摘要: 传统 let info={ title:"0", link:"1" ,go:function (){ console.log("2"); } } / 通过点获取 console.log(info.title); // 通过[]获取 console.log(info["title"]) es6 相当于 阅读全文
posted @ 2021-09-01 10:35 老运维 阅读(136) 评论(0) 推荐(0)
摘要: 1如果key和变量的名字一致,可以指定义一次即可 2如果value是一个函数,可以把:funtion去掉 只剩()即可 let info={ title:"0", link:"1" ,go:function (){ console.log("2"); } } var title="0"; var l 阅读全文
posted @ 2021-09-01 09:58 老运维 阅读(54) 评论(0) 推荐(0)
摘要: 1取掉function 2.在括号前面加箭头 3如果逻辑代码仅有return可以直接省去 4如果参数只有一个,可以把括号舍省去 ... <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title 阅读全文
posted @ 2021-08-31 23:07 老运维 阅读(37) 评论(0) 推荐(0)
摘要: layui.define(function(exports){ // 需确保您的 layui.js 是引入的构建后的版本(即官网下载或 git 平台的发行版) //直接可得到各种内置模块 var layer = layui.layer; //… layer.msg('Hello World'); e 阅读全文
posted @ 2021-08-18 07:45 老运维 阅读(52) 评论(0) 推荐(0)