很抱歉,您没有提供需要改写的句子。请提供您希望改写的句子,我将为您改写为一个长尾词的。
- 内容介绍
- 文章标签
- 相关推荐
本文共计203个文字,预计阅读时间需要1分钟。
sendGiveWeb: { code: 200, success: true, data: [{id: 1230, name: lh}, {id: 1331, name: lh}, {id: 1233, name: lh}], length: 0 }, mounted() { this.tholy(); }, methods: { tholy() { // data和this.sendGiveWeb.length必须是值 } }
sendGiveWeb: {code: 200,
success: true,
data: [
{ id: "1230", name: "lh" },
{ id: "1331", name: "lh" },
{ id: "1233", name: "lh" },
],
length: 0
} mounted() {
this.tholy();
},
methods: {
tholy() {
//data和this.sendGiveWeb.length必须是值而且是为true的
//为啥这里要写短路运算符 因为有些时候需要两个同时存在
if (this.sendGiveWeb.data && this.sendGiveWeb.length) {
alert(1);
}
}
}有些时候 真的有必要将短路运算符 添加到判断条件中去 这样可以提高代码的健壮性哈。
遇见问题,这是你成长的机会,如果你能够解决,这就是收获。
作者:晚来南风晚相识
本文共计203个文字,预计阅读时间需要1分钟。
sendGiveWeb: { code: 200, success: true, data: [{id: 1230, name: lh}, {id: 1331, name: lh}, {id: 1233, name: lh}], length: 0 }, mounted() { this.tholy(); }, methods: { tholy() { // data和this.sendGiveWeb.length必须是值 } }
sendGiveWeb: {code: 200,
success: true,
data: [
{ id: "1230", name: "lh" },
{ id: "1331", name: "lh" },
{ id: "1233", name: "lh" },
],
length: 0
} mounted() {
this.tholy();
},
methods: {
tholy() {
//data和this.sendGiveWeb.length必须是值而且是为true的
//为啥这里要写短路运算符 因为有些时候需要两个同时存在
if (this.sendGiveWeb.data && this.sendGiveWeb.length) {
alert(1);
}
}
}有些时候 真的有必要将短路运算符 添加到判断条件中去 这样可以提高代码的健壮性哈。
遇见问题,这是你成长的机会,如果你能够解决,这就是收获。
作者:晚来南风晚相识

