04 2021 档案
摘要:##GitHub地址 https://github.com/mroderick/PubSubJS ##案例——两个兄弟组件通讯 ,search搜索框组件,list列表组件 1.Search.jsx import React, { Component } from 'react' import Pub
阅读全文
摘要:react脚手架配置代理总结 方法一 在package.json中追加如下配置 "proxy":"http://localhost:5000" 说明: 优点:配置简单,前端请求资源时可以不加任何前缀。 缺点:不能配置多个代理。 工作方式:上述方式配置代理,当请求了3000不存在的资源时,那么该请求会
阅读全文
摘要:路由组件与一般组件 1.写法不同: 一般组件:<Demo/> 路由组件:<Route path="/demo" component={Demo}/> 2.存放位置不同: 一般组件:components 路由组件:pages 3.接收到的props不同: 一般组件:写组件标签时传递了什么,就能收到什么
阅读全文
摘要:1.明确好界面中的导航区、展示区 2.导航区的a标签改为Link标签 <Link to="/xxxxx">Demo</Link> 3.展示区写Route标签进行路径的匹配 <Route path='/xxxx' component={Demo}/> 4.<App>的最外侧包裹了一个<BrowserR
阅读全文
摘要:印记中文:https://docschina.org/ MDN:https://developer.mozilla.org/zh-CN/ Babel中文网:https://www.babeljs.cn/ Request.js:https://github.com/octokit/request.js
阅读全文
摘要://记得引入use/think/Db; public function change_limit_switch(){ $sql='update elephone_reservation set limit_switch = replace(limit_switch,0,1)'; $res=Db::e
阅读全文
摘要:<script type="text/babel"> //创建组件 class Demo extends React.Component{ state = {isHot:false} showInfo = ()=>{ const {input1} = this alert(input1.value)
阅读全文
摘要:1.字符串形式(官方以不推荐使用) <script type="text/babel"> //创建组件 class Demo extends React.Component{ //展示左侧输入框的数据 showData = ()=>{ const {input1} = this.refs alert
阅读全文
摘要:<script type="text/babel"> //创建组件 function Person (props){ const {name,age,sex} = props return ( <ul> <li>姓名:{name}</li> <li>性别:{sex}</li> <li>年龄:{age
阅读全文
摘要:<script type="text/babel"> //创建组件 class Person extends React.Component{ render(){ // console.log(this); const {name,age,sex} = this.props //props是只读的
阅读全文
摘要:<script type="text/babel"> //1.创建组件 class Weather extends React.Component{ //构造器调用几次? ———— 1次 constructor(props){ console.log('constructor'); super(pr
阅读全文
摘要:<script type="text/javascript" > let arr1 = [1,3,5,7,9] let arr2 = [2,4,6,8,10] console.log(...arr1); //展开一个数组 let arr3 = [...arr1,...arr2]//连接数组 cons
阅读全文
摘要:<script type="text/babel"> //1.创建类式组件 class MyComponent extends React.Component { render(){ //render是放在哪里的?—— MyComponent的原型对象上,供实例使用。 //render中的this是
阅读全文
摘要:<script type="text/babel"> //1.创建函数式组件 function MyComponent(){ console.log(this); //此处的this是undefined,因为babel编译后开启了严格模式 return <h2>我是用函数定义的组件(适用于【简单组件
阅读全文
摘要:<script type="text/babel" > const myId = 'aTgUiGu' const myData = 'HeLlo,rEaCt' //1.创建虚拟DOM const VDOM = ( <div> <h2 className="title" id={myId.toLowe
阅读全文
摘要:一.字符串与数组之间的相互转换 1、字符串转换为数组 str.split(','); // 以逗号,为拆分的字符串 2、数组转换为字符串 arr.join(','); // 把数组项拼接成字符串,以逗号,分隔 二.Json字符串转换为json对象 1、使用eval result = eval('('
阅读全文
摘要://解析emoji字符 public function userTextDecode($str){ $text = json_encode($str); //暴露出unicode $text = preg_replace_callback("/\\\\\\\\/i",function($str){
阅读全文
摘要://获取接下来一周的日期 function GetWeeks() { $i=0; $weeks=[]; for ($i;$i<=7;$i++){ $month=date('m',time()+86400*$i).'月'; $day=date('d',time()+86400*$i).'日';
阅读全文
摘要:这个问题是我在宝塔面板上遇到的 他的意思是:出于安全原因,已禁用pcntl\ U fork() 解决问题: 第一步:从软件商店找到php版本,点击设置 第二步:找到禁用函数:把pcntl_fork函数删掉,如果还报错出现别的比如pcntl.wait has been disabled for sec
阅读全文

浙公网安备 33010602011771号