1 Star 0 Fork 0

support73/bookshelf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
note.txt 561 Bytes
一键复制 编辑 原始数据 按行查看 历史
陈俊 提交于 2019-01-24 21:44 +08:00 . refresh start
observer:function(newVal){
if(newVal){
const author = util.getAuthor(newVal.author)
this.setData({
author
})
虽然可以这样写 但是 Bad
const _book = Object.assign({}, this.properties.book,{
author:util.getAuthor(newVal.author)
})
AirBnb推荐的写法
const _book = {
...newVal,
author:util.getAuthor(newVal.author)
}
this.setData({
_book
})
这样做也是不行的 无法生效
this.properties.book.author = util.getAuthor(newVal.author)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/support73/bookshelf.git
git@gitee.com:support73/bookshelf.git
support73
bookshelf
bookshelf
master

搜索帮助