git命令 、 React生命周期钩子、弹性盒flex的属性

本文涵盖了git常用命令,如add、commit、merge等,探讨了React生命周期中的函数式无状态组件和组件更新阶段,并讲解了小程序开发框架如Mpvue和Taro。同时,文章还深入浅出地介绍了Flex布局的浏览器兼容性和相关属性。

git命令你知道哪些?

git add .
git commit -m
git merge
git checkout 分支名称
git branch 分支名称
git push
git pull 更新
git 冲突:
(主线)手动合并之后,在上传
(分支)git pull 先更新 , 在上传
“MVVM”:双向数据绑定,View的变动,映射在 ViewModel,反之一样

混合开发 - 小程序

是否使用过小程序框架
Mpvue taro
小程序请求?
使用promise

React生命周期钩子

//初始化
getDefaultPorps
getInitalState
componentWillMount
render
componentDidMount

//运行中
    componentWillReceiveProps
    shouldComponentUpdate
    componentWillUpdate
    componentDidUpdate
    
//销毁
    componentWillUnmount

// 16.x
// 初始化
constructor
sataic getDeviredStateFromProps // 未来版本
componentWillMount
render
componentDidMount
// 更新阶段
componentWillReceiveProps
shouldComponentUpdate
componentWillUpdate
getSnapshotBeforeUpdate() // ---- 将来会使用
componentDidUpdate
// 销毁阶段
componentWillUnmount
// 错误处理阶段
componentDidCatch

1. 函数式无状态组件

  1. es5方式 React.createClass组件
  2. es6方式 class
    函数式组件:function myConponent(props) {
    return Hello{props.name}
    }
    class组件:class App extends React.Component {
    handleClick() {
    this.props.dispatch({ type: ‘app/create’ });
    }
    render() {
    return
    }
    }

1. 面向对象继承

  • 原型继承
  • 原型链继承
  • 混合继承
  • 类继承

2. this改变的方式

  • call
  • apply
  • bind

一、flex的浏览器内核兼容写法

{
display:-webkit-flex;
display:-moz-box;
display:-mz-flexbox;
display:flex;
}

二、容器上的六个属性、容器内的子项目上的六个属性
①、容器上的六个属性:

   flex-direction: 决定子项目主轴的方向(默认值为row)

   flex-wrap: 决定子项目是否换行(默认值是不换行nowrap)

   flex-flow: direction wrap的合并写法

   justify-content: 决定子项目(水平)横向布局方式(默认值flex-start)

   align-items: 决定子项目(垂直)纵向布局方式(默认值stretch)

   align-content: 子项目有多列时,决定子项目的纵向布局方式(默认值flex-start)

②、容器内的子项目的六个属性:

   order: 设置子项目的顺序(默认为0)

   flex-grow:  子项目是否可扩大(默认为0,不扩大)

   flex-shrink:   子项目是否可缩小(默认为1,可缩小)(0是false,1是true)

   flex-basis:  设置子项目的初始宽度(默认为auto)

   flex: grow、shrink、basis合并

   align-self: 设置子项目(垂直)纵向方向的位置(默认值stretch)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值