06 2019 档案
摘要:import React, {Component} from 'react'; class Home extends Component { constructor(props) { super(props) this.state = { value: '' } this.input = React...
阅读全文
摘要:import React from 'react' class Home extends React.Component{ constructor(props){ super(props) this.state = { msg: 'Home组件中的数据' } this.getMessage = th...
阅读全文
摘要:import React from 'react' import img from '../public/img/001.jpg' // 此时img是一个变量,在下面直接使用该变量即可引入该图片 class New extends React.Component{ constructor(props) { super(props) this.state =...
阅读全文
摘要:let fd = new FormData() // 定义传递的序列化对象,for (let i = 0; i < addArr.length; i++) { // addArr是选中文件的输入框中的e.target.files fd.append(addArr[i].name + "", addArr[i]) //通过append()将键名和值放进去 } 此时将上传的文件序列化后,如果还...
阅读全文
摘要:组件基本使用import React, { Component } from 'react'; // 在组件头部引用class Home extends Component { // 创建类 render(){ // 将页面通过return返回给调用者 必须有一个根节点包裹 同vue的使用 retu
阅读全文
摘要:1.火狐和IE不支持input 的accept属性,上传的文件需要使用e.target.files[index].type来手动判断 2.火狐浏览器在input框输入之后,刷新页面,原先的值会被保留,需要在form表单上或者指定输入框上添加 autocomplete="off"属性
阅读全文
摘要:动态插入的html,需要使用delegate或者on事件来监听,方式如下。 如果需要获取节点对应的下标,$(this).index()是无法获取的,需要以$(selectot).index(this)方式来获取$('body').on('click', '.delete-pic', function
阅读全文
摘要:https://www.jb51.net/article/144355.htm
阅读全文

浙公网安备 33010602011771号