- 博客(21)
- 收藏
- 关注
原创 react-router 侧边栏
1.react-router 官网地址 reacttraining.cn2.代码如下:(第一种实现方式)import React, { Component } from 'react';import { BrowserRouter as Router, Route, Link,} from 'react-router-dom';class SlideBar1 ext...
2018-06-16 11:30:27
1933
原创 react-router 未匹配
1.Redirect 匹配当前地址时,重定向到另外一个地址import React, { Component } from 'react';import { BrowserRouter as Router, Route, Link, Switch, Redirect,} from 'react-router-dom';const Home = ()=...
2018-06-12 21:28:39
1666
原创 unable to decode value
1.假如我们在列表页搜索一个关键词,这时发现报错了,如下图所示:我们一看发现给后台传的关键词是 unable to decode value解决方案:(1)在form上加 accept-charset ='UTF-8'(2)在得到搜索的关键词时进行转码,let value = encodeURIComponent(e.target.value);encodeURIComponent () 把字符串...
2018-06-11 21:56:39
7628
原创 react-router基本使用
react-router网站 http://reacttraining.cn/学习react-router中遇到的问题1.这段代码会存在啥问题呢?render () { return ( <Router> <ul> <li> ...
2018-06-09 18:20:26
4149
原创 react-native 使用Flexbox布局
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, {Component} from 'react';import { AppRegistry,Text,View,StyleSheet,} from 'react-native';expor...
2018-02-20 20:34:39
207
原创 react-native 宽度和高度
指定宽度和高度react-native中的尺寸都是无单位的,表示的是与设备像素密度无关的逻辑像素点。/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, {Component} from 'react';import { AppRegistry,...
2018-02-20 19:14:31
3554
原创 react-native样式
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, {Component} from 'react';import { AppRegistry,Text,View,StyleSheet,} from 'react-native';expor...
2018-02-20 18:39:12
309
原创 react-native state
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, {Component} from 'react';import { AppRegistry,Text,View } from 'react-native';class Blink exte...
2018-02-20 01:31:45
285
原创 react-native Props
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, {Component} from 'react';import { AppRegistry,Text,View } from 'react-native';class Bananas ex...
2018-02-20 01:03:20
258
原创 react-native props
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, {Component} from 'react';import { AppRegistry,Image} from 'react-native';export default class ...
2018-02-20 00:52:49
360
原创 react-native Hello World
react-native和react用法很相似,如果你用过react,那么学react-native相对容易多了。如果没有学过,也没有关系。下面是一个react-native的Hello,World!小例子/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import R...
2018-02-19 23:09:08
158
原创 蚂蚁金服antd-Table-可选择
/** * Created by mapbar_front on 2018/1/28. */import React,{ Component } from 'react';import { Table,Icon,Divider } from 'antd';let data = [{ key: 1, name: '花骨朵', age: 18, hobby:
2018-01-28 19:19:57
7199
2
原创 蚂蚁金服antd-Table-JSX风格的API
/** * Created by mapbar_front on 2018/1/28. */import React,{ Component } from 'react';import { Table,Icon,Divider } from 'antd';const { Column,ColumnGroup } = Table;let data = [{ key: 1
2018-01-28 15:58:35
2095
1
原创 蚂蚁金服antd-Table-基本用法
/** * Created by mapbar_front on 2018/1/27. */import React,{ Component } from 'react';import { Table,Icon,Divider } from 'antd';const data = [{ key: 1, name: '天下', age: 18, hobb
2018-01-27 22:47:23
4541
原创 蚂蚁金服(antd)-Table(3)
import React,{ Component} from 'react';import { Table } from 'antd';const dataSource = [{ key: '1', name: '碗碗香', age: 22, address: '北京市', action: '习惯优秀', render: text=> { tex
2018-01-08 00:28:03
1380
原创 蚂蚁金服-antd-Table(2)
import React,{ Component} from 'react';import { Table, Icon, Divider } from 'antd';const { Column,ColumnGroup } = Table;const dataSource = [{ key: 1, firstName: '小小', lastName: '天下',
2018-01-07 23:31:38
1226
原创 antd Table学习(1)
效果如下:import 'antd/dist/antd.css';import React,{ Component } from 'react';import { Table } from 'antd';//import './App.css';//dataSource 一个数组中包含好多对象,每个对象就是一组数据const dataSource = [{ key: '1
2018-01-07 21:52:05
1646
原创 JS排序
众所周知,在数据结构中有10大排序,分别是: 1.冒泡排序 2.选择排序 3.插入排序 4.希尔排序 5.归并排序 6.快速排序 7.堆排序 8.计数排序 9.桶排序 10.计数排序在这里我只介绍一下冒泡算法和快速排序的算法 冒泡排序 思想: 每次比较相邻的两个数,大的数一直向下沉,小的数一直上升。类似于冒泡。function sort(arr) { for( v
2017-12-19 19:28:19
123
原创 数组去重
三种方法 原数组var arr = [2,3,4,1,1,1,2,3,4,5];设定一个新的数组(newArr),下文中用到。1.遍历原数组,用新的数组进行判断 2.定义一个空对象,判断空对象中是否有原数组遍历之后的每一项 3.对原数组进行排序,然后和自身的下一项进行比较,如果相等的话就截取。这只是一个思路概括,不理解的可以看我的上一篇文章。
2017-12-16 11:35:51
153
原创 数组去重
数组去重可谓面试题经典呢,如果能用多种方式实现的话,那么至少会给面试官留下一定的好感,觉得你的思维很广阔。在这里我向大家介绍3种方法实现 我们在这里顶一个数组 var arr = [3,5,5,5,1,2,3,4]; 方法1: 遍历数组,定义一个新的数组(newarr),用indexOf()判断是否在新的数组(newarr)中出现原数组中的每一项,如果没有出现,就push进去。代码如下:fu
2017-12-16 01:26:12
240
原创 盒子居中(常用的方法)
想必大家都知道,盒子居中不论在项目中还是在面试题中都是常见的对吧!今天我主要分享四种方法,希望对各位同学有一定的帮助。 场景: 假如这里有一个父盒子(parent),子盒子(child),我们需要得到的结果是让子盒子相对父盒子居中,也就是说子盒子在父盒子中居于中间的位置。 ,以便于大家更好的理解。盒子居中一般有两种类型, 1.宽度和高度已经确定的。 2.宽度和高度未确定的。有四种解决方案:
2017-12-15 21:52:09
3941
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人