摘要: <script type="text/babel"> //1.创建类式组件 class MyComponent extends React.Component { render(){ //render是放在哪里的?—— MyComponent的原型对象上,供实例使用。 //render中的this是 阅读全文
posted @ 2021-04-20 14:57 大海啊都是水啊水 阅读(122) 评论(0) 推荐(0)
摘要: <script type="text/babel"> //1.创建函数式组件 function MyComponent(){ console.log(this); //此处的this是undefined,因为babel编译后开启了严格模式 return <h2>我是用函数定义的组件(适用于【简单组件 阅读全文
posted @ 2021-04-20 14:49 大海啊都是水啊水 阅读(360) 评论(0) 推荐(0)
摘要: <script type="text/babel" > const myId = 'aTgUiGu' const myData = 'HeLlo,rEaCt' //1.创建虚拟DOM const VDOM = ( <div> <h2 className="title" id={myId.toLowe 阅读全文
posted @ 2021-04-20 13:37 大海啊都是水啊水 阅读(45) 评论(0) 推荐(0)
摘要: 一.字符串与数组之间的相互转换 1、字符串转换为数组 str.split(','); // 以逗号,为拆分的字符串 2、数组转换为字符串 arr.join(','); // 把数组项拼接成字符串,以逗号,分隔 二.Json字符串转换为json对象 1、使用eval result = eval('(' 阅读全文
posted @ 2021-04-13 17:28 大海啊都是水啊水 阅读(1450) 评论(0) 推荐(0)
摘要: //解析emoji字符 public function userTextDecode($str){ $text = json_encode($str); //暴露出unicode $text = preg_replace_callback("/\\\\\\\\/i",function($str){ 阅读全文
posted @ 2021-04-08 17:13 大海啊都是水啊水 阅读(100) 评论(0) 推荐(0)
摘要: //获取接下来一周的日期 function GetWeeks() { $i=0; $weeks=[]; for ($i;$i&lt;=7;$i++){ $month=date('m',time()+86400*$i).'月'; $day=date('d',time()+86400*$i).'日'; 阅读全文
posted @ 2021-04-06 11:10 大海啊都是水啊水 阅读(107) 评论(0) 推荐(0)
摘要: 这个问题是我在宝塔面板上遇到的 他的意思是:出于安全原因,已禁用pcntl\ U fork() 解决问题: 第一步:从软件商店找到php版本,点击设置 第二步:找到禁用函数:把pcntl_fork函数删掉,如果还报错出现别的比如pcntl.wait has been disabled for sec 阅读全文
posted @ 2021-04-02 09:58 大海啊都是水啊水 阅读(774) 评论(0) 推荐(0)
摘要: 图片格式类型验证正则表达式:上传图片的时候,一般会限定图片的上传格式,下面就介绍一下和实现才功能。代码实例如下: str="antzone.jpeg"; var reg=/(.*)\\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$/; console.log 阅读全文
posted @ 2021-03-31 15:22 大海啊都是水啊水 阅读(1714) 评论(0) 推荐(0)
摘要: App.js代码 /** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, {Component} from 'react';import { AppRegist 阅读全文
posted @ 2021-03-31 10:00 大海啊都是水啊水 阅读(145) 评论(0) 推荐(0)
摘要: 第三方接口地址:https://www.tianapi.com/apiview/139 /** * 获取日期,判断是否是节假日 */public function get_date(){ $success=[ 'statusCode' => '1', 'message'=>'写入date.json成 阅读全文
posted @ 2021-03-10 09:42 大海啊都是水啊水 阅读(875) 评论(0) 推荐(0)