2020年8月14日
摘要: 创建正则表达式对象 两种: 1.通过构造函数创建对象 2.字面量的方式创建对象 正则表达式的作用: 匹配字符串的 //对象创建完毕 var reg = new RegExp(/\d{5}/); //调用方法验证字符串是否匹配 var flag = reg.test("我的电话是10086"); co 阅读全文
posted @ 2020-08-14 08:20 treesky 阅读(585) 评论(0) 推荐(0) 编辑
  2020年8月13日
摘要: 评论列表组件 import React from 'react' import CMTItem from './CmtItem.jsx' import CMTBox from './CmtBox.jsx' // 评论列表组件 export default class CMTList extends 阅读全文
posted @ 2020-08-13 08:20 treesky 阅读(244) 评论(0) 推荐(0) 编辑
  2020年8月12日
摘要: 背景: 项目基于原生js,没用到任何脚手架和框架,但也需要打包压缩。 项目的js中声明了一些全局变量 供其他js调用。 这时候如果用webpack打包,基于webpack特性,会嵌套一层大函数,会将js中的变量变成局部,不能供其他js调用。 因此弃用了webpack。选用了uglifyjs。 原因: 阅读全文
posted @ 2020-08-12 20:21 treesky 阅读(1029) 评论(0) 推荐(0) 编辑
摘要: 基本组件的使用介绍 View: Text: TextInput: Image: Button: ActivityIndicator: ScrollView:这是一个列表滚动的组件 ListView:也是一个列表滚动的组件,但是,这个组件已经过时了,官方推荐使用 FlatList 来代替它 index 阅读全文
posted @ 2020-08-12 15:21 treesky 阅读(185) 评论(0) 推荐(0) 编辑
  2020年8月11日
摘要: app.module import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import {FormsModule} from '@angular/fo 阅读全文
posted @ 2020-08-11 15:21 treesky 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 满足最小分组的长度为其他分组的整数倍 export default (arr) => { // 对这副牌进行排序,升序、降序都可以 arr.sort((a, b) => a - b) let min = Number.MAX_SAFE_INTEGER let dst = [] let result 阅读全文
posted @ 2020-08-11 08:20 treesky 阅读(147) 评论(0) 推荐(0) 编辑
  2020年8月10日
摘要: font-family属性值:具体字体名或者字体集 如果是中文或者有单词之间有空格,需要加双引号 字体集: Serif (有装饰线) Sans-serif (无装饰线) Monospace Cursive Fantasy <!DOCTYPE html> <html lang="en"> <head> 阅读全文
posted @ 2020-08-10 08:20 treesky 阅读(207) 评论(0) 推荐(0) 编辑
  2020年8月9日
摘要: on注册事件的2种方式 on注册事件的语法 on注册简单事件 // 这个是p自己注册的事件(简单事件) $("p").on("click", function () { alert("呵呵"); }); $("#btn").on("click", function () { $("<p>我是新建的p 阅读全文
posted @ 2020-08-09 20:21 treesky 阅读(342) 评论(0) 推荐(0) 编辑
摘要: css3背景图像相关 兼容性:IE9+ background-clip 背景图片绘制区域 background-clip:border-box; 内容区 <!DOCTYPE html> <html lang="en" manifest="index.manifest"> <head> <meta c 阅读全文
posted @ 2020-08-09 15:21 treesky 阅读(1007) 评论(0) 推荐(0) 编辑
  2020年8月8日
摘要: html鼠标事件 onload 页面加载 onclick 鼠标单击 onmouseover 鼠标移入 onmouseout 鼠标移出 onfocus 获取焦点 onblur 失去焦点 onchange 域的内容改变 在事件触发中,this表示对当前dom对象的引用 1、html事件,在html元素上 阅读全文
posted @ 2020-08-08 20:21 treesky 阅读(2800) 评论(0) 推荐(0) 编辑