有谁知道如何将选中的值传递给 Lightning Web 组件中的复选框?
我的代码如下所示:
import { LightningElement, track } from 'lwc';
export default class MyComponent extends LightningElement {
@track isChecked;
constructor() {
super();
isChecked = false;
}
}Run Code Online (Sandbox Code Playgroud)
<template>
<lightning-card title="My Card" icon-name="custom:custom9">
<div class="slds-m-around_medium">
<lightning-input type="checkbox" label="my checkbox" name="input1" checked="{isChecked}"></lightning-input>
</div>
</lightning-card>
</template>Run Code Online (Sandbox Code Playgroud)
但它不起作用。
我在解决挑战 7 时遇到问题 我在 JS 文件中有所需的导入和所需的函数。仍然#Trailhead 给出错误:
\n我们可以在组件boatsNearMe控制器中\xe2\x80\x99找到getLocationFromBrowser()函数。确保组件是按照要求创建的,包括使用“getCurrentPosition()”获取navigator\xe2\x80\x99s地理位置,箭头符号用“position =>”,从位置,并使用正确的区分大小写将它们分配给控制器\xe2\x80\x99s 属性“纬度”和“经度”。
\n
---- 删除了代码部分以遵守 Trailhead 的政策 ----
\n我想这是我在代码中遗漏的东西。
\n我是 DynamoDB 的新手,我有一个小型内部应用程序,我的父母将使用它来处理他们的小型业务。我只需要每天保留 10 - 20 行记录,并且最多进行一些接近 5 - 10 行的编辑。我可以使用 Dynamo DB 的免费套餐吗?
我正在使用 Heroku 托管我的 LWC OSS (Node JS) 应用程序,这又是一个免费版本。如果没有,那么任何特定类型的数据库都可以满足我的需求。
我无法完成挑战“亲身体验新警报、确认和提示模块和组件”。我很确定这个挑战有一个错误,我想知道我犯了一个错误,或者这个挑战有错误。
分配:
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.
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的解决方案:
import { LightningElement, api } from "lwc";
import LightningConfirm from "lightning/confirm";
export default …Run Code Online (Sandbox Code Playgroud)