09 2020 档案
摘要:问题: 在使用 vue 进行开发的过程中,可能会遇到一种情况:当生成vue实例后,再次给数据赋值时,有时候并不会自动更新到视图上去。也就是如果在实例创建之后添加新的属性到实例上,它不会触发视图更新。 vue遍历数组对象进行渲染 <div class="hisItem" v-for="(item,in
阅读全文
摘要:数据请求方式 get,获取数据 post,提交数据(表单提交以及文件上传) put,更新数据 (提交所有的数据) patch,提交数据 (提交修改的数据) delete,删除数据 1.get方法的使用 params会出现在请求头中的querry string parameters中,并且会出现在浏览
阅读全文
摘要:1. 挂载卸载过程 1.1.constructor() 1.2.componentWillMount() 1.3.componentDidMount() 1.4.componentWillUnmount () 2. 更新过程 2.1. componentWillReceiveProps (nextP
阅读全文
摘要:1.行间定义事件后面使用bind绑定this 使用bind来修改this的指向,需要注意的是bind括号内第一个参数是修改this的,后面可以设置其他参数进行传值。代码如下: run(){ alert("第一种方法!") } <button onClick={this.run.bind(this)}
阅读全文