我希望你能帮我翻译涉及IT技术的文本,这段需要翻译的内容是关于完成“使用新的警报、确认和提示模块和组件”挑战的问题。
我相信这个挑战存在一个错误,但我想知道是我犯了错还是该挑战有误。
任务要求:
import { LightningElement, api } from "lwc";
export default
class recordCardQuickFiles extends LightningElement {
@api
recordId;
onDeleteAllFilesButtonClick() {
const confirmation = confirm("Are you sure you want to delete all files?");
if (confirmation) {
//... proceed with
//... Apex Logic to delete Files.
//... We will not check this comment.
}
}
}
- 创建新的Lightning Web组件
- 名称:recordCardQuickFiles
- 从"lightning/confirm"导入LightningConfirm
- 使用LightningConfirm方法替换confirm方法
- 消息:"您确定要删除所有文件吗?"
- 变体:"headerless"
- 标签:"您确定要删除所有文件吗?"
我的解决方案:
import { LightningElement, api } from "lwc";
import LightningConfirm from "lightning/confirm";
export default
class recordCardQuickFiles extends LightningElement {
@api
recordId;
configs = {
Message: "Are you sure you want to delete all files?",
Label: "Are you sure you want to delete all files?",
Variant: "headerless"
}
onDeleteAllFilesButtonClick() {
const confirmation = LightningConfirm.open(this.configs);
if (confirmation) {
//... proceed with
//... Apex Logic to delete Files.
//... We will not check this comment.
}
}
}
出现错误:你的.org中的挑战尚未完成。 LightningConfirm方法中使用的消息不正确。