this.$message.失败
时间: 2023-09-14 09:15:03 浏览: 105
根据引用,this.$message({ type: "warning", message: "设置失败!" }); 表示设置失败的警告信息。
这段代码是调用了this.$message函数,传递了一个对象作为参数,其中type属性被设置为"warning",message属性被设置为"设置失败!",所以this.$message.失败信息就是"设置失败!"。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
相关问题
this.$message.失败信息
根据引用,this.$message({ type: "warning", message: "设置失败!" }); 表示设置失败的警告信息。
这段代码是调用了this.$message函数,传递了一个对象作为参数,其中type属性被设置为"warning",message属性被设置为"设置失败!",所以this.$message.失败信息就是"设置失败!"。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [TypeError: this.$message is not a function报错情况解决](https://blog.csdn.net/Vivien_CC/article/details/126946447)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [this.$message](https://blog.csdn.net/song854601134/article/details/122724205)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
methods: { adaOrder() { if (!this.multipleSelection.length) { this.$message.warning("下单失败,未选择图书") return } if (!this.addressid) { this.$message.warning("下单失败,请选择地址") return } this.request.post("/orders/addOrder?addressid=" + this.addressid, this.multipleSelection).then(res => { if (res.code === '200') { this.$message.success("下单成功") this.load() this.addressid = 0 } else { this.$message.error(res.msg) } }) 添加注释
// 定义一个名为 adaOrder 的方法
adaOrder() {
// 如果没有选择图书,则提示下单失败并返回
if (!this.multipleSelection.length) {
this.$message.warning("下单失败,未选择图书")
return
}
// 如果没有选择地址,则提示下单失败并返回
if (!this.addressid) {
this.$message.warning("下单失败,请选择地址")
return
}
// 发送请求,调用后端接口添加订单,并传递地址id和所选图书的信息
this.request.post("/orders/addOrder?addressid=" + this.addressid, this.multipleSelection).then(res => {
// 如果返回码为200,则下单成功,提示用户并重新加载数据
if (res.code === '200') {
this.$message.success("下单成功")
this.load()
this.addressid = 0
} else {
// 如果返回码不为200,则下单失败,提示用户失败原因
this.$message.error(res.msg)
}
})
}
阅读全文