12 2018 档案

摘要:通过 ngModel 跟踪修改状态与有效性验证 验证表单输入 响应式表单 状态 为真时的 CSS 类 为假时的 CSS 类 控件被访问过。 ng-touched ng-untouched 控件的值变化了。 ng-dirty ng-pristine 控件的值有效。 ng-valid ng-invali 阅读全文
posted @ 2018-12-27 14:47 Ajanuw
摘要:@observable obj = { name: "ajanuw", age: 22, }; @computed get list() { return _.toPairs(this.obj); } {list.map(([k, v]) => (<div>{k}:{v}</div>))} 阅读全文
posted @ 2018-12-26 11:07 Ajanuw 阅读(94) 评论(0) 推荐(0)
摘要:函数组件 必须为props定义 类型 export const Header = (props: { text: string }) => <h2>{props.text}</h2>; <Header text="hello" /> FC 类型包含children属性 export const He 阅读全文
posted @ 2018-12-24 23:50 Ajanuw
摘要:"文档地址" index.html util.js 使用 阅读全文
posted @ 2018-12-23 17:30 Ajanuw 阅读(2427) 评论(0) 推荐(1)
摘要:import LazyLoad from "react-lazyload"; function Placeholder() { return <img src={catJpg} />; } <ul> {this.images.map(el => ( <li key={el.id} > <LazyLo 阅读全文
posted @ 2018-12-21 21:59 Ajanuw
摘要:“ref”对象是一个通用容器,其current属性是可变的 保存dom 保存事件程序 存储以前的值 阅读全文
posted @ 2018-12-20 21:17 Ajanuw 阅读(1996) 评论(0) 推荐(0)
摘要:``` import { createForm } from "rc-form"; @createForm() class TopAdSlots extends Component { @observable vs = []; @action handlePickerChange = vs => { this.vs = vs; }; render() { ... 阅读全文
posted @ 2018-12-19 19:48 Ajanuw 阅读(2156) 评论(0) 推荐(0)
摘要:import React, { useState, useEffect, useContext } from "react"; import axios from "axios"; const l = console.log; const BodyContext = React.createCont 阅读全文
posted @ 2018-12-19 11:58 Ajanuw 阅读(152) 评论(0) 推荐(0)
摘要:react hooks文档 设置 state import React, { useState } from "react"; const l = console.log; function Test() { const [n, setN] = useState(0); const [info, s 阅读全文
posted @ 2018-12-16 21:20 Ajanuw 阅读(605) 评论(0) 推荐(0)
摘要:简单的日历组件 import React, { Component } from "react"; import as _ from "lodash"; const l = console.log; const weeks = ["日", "一", "二", "三", "四", "五", "六"]; 阅读全文
posted @ 2018-12-11 08:51 Ajanuw 阅读(2517) 评论(0) 推荐(1)
摘要:"https://lbs.qq.com/tool/component picker.html" withMap 使用 阅读全文
posted @ 2018-12-10 15:29 Ajanuw 阅读(1436) 评论(0) 推荐(0)
摘要:装饰器 使用 阅读全文
posted @ 2018-12-01 16:31 Ajanuw 阅读(2149) 评论(0) 推荐(0)