{"id":3909,"date":"2024-01-22T21:37:09","date_gmt":"2024-01-22T13:37:09","guid":{"rendered":"http:\/\/www.ponybai.com\/?p=3909"},"modified":"2023-12-02T21:37:49","modified_gmt":"2023-12-02T13:37:49","slug":"%e6%b5%81flow","status":"publish","type":"post","link":"http:\/\/www.ponybai.com\/?p=3909","title":{"rendered":"Flow\u00a0"},"content":{"rendered":"\n<p>Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-flow-screen-components\">\u521b\u5efa\u6d41\u5c4f\u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u6b63\u5982\u7ba1\u7406\u5458\u5728 Lightning App Builder \u4e2d\u914d\u7f6e\u8bb0\u5f55\u9875\u9762\u7684\u7528\u6237\u4f53\u9a8c\u4e00\u6837\uff0c\u4ed6\u4eec\u4f7f\u7528\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u4e3a\u6d41\u7528\u6237\u6267\u884c\u76f8\u540c\u7684\u64cd\u4f5c\u3002\u6bcf\u4e2a\u5c4f\u5e55\u90fd\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5c4f\u5e55\u7ec4\u4ef6\u7ec4\u6210\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure-a-component-for-flow-screens\">\u4e3a\u6d41\u5c4f\u5e55\u914d\u7f6e\u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u8981\u5728\u6d41\u7a0b\u5c4f\u5e55\u4e2d\u4f7f\u7528\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\uff0c\u8bf7\u5c06\u4e00\u4e9b\u5143\u6570\u636e\u6dfb\u52a0\u5230\u7ec4\u4ef6\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002<\/p>\n\n\n\n<p><code>componentName.js-meta.xml<\/code>\u00a0\u6587\u4ef6\u5b9a\u4e49\u7ec4\u4ef6\u7684\u5143\u6570\u636e\u503c\uff0c\u5305\u62ec\u7528\u4e8e\u6d41\u5c4f\u5e55\u7684\u7ec4\u4ef6\u7684\u8bbe\u8ba1\u914d\u7f6e\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u82e5\u8981\u4f7f\u7ec4\u4ef6\u5728\u6d41\u5c4f\u5e55\u4e2d\u53ef\u7528\uff0c\u8bf7\u6dfb\u52a0\u76ee\u6807\u3002<code>lightning__FlowScreen<\/code><\/li>\n\n\n\n<li>\u82e5\u8981\u5411\u7ec4\u4ef6\u6dfb\u52a0\u8f93\u5165\u5b57\u6bb5\uff0c\u8bf7\u6dfb\u52a0\u5c5e\u6027\u3002<code>targetConfig<\/code><\/li>\n\n\n\n<li>\u82e5\u8981\u5c06\u5c5e\u6027\u9650\u5236\u4e3a \u6216 \uff0c\u8bf7\u4f7f\u7528\u8be5\u7279\u6027\u3002\u4f8b\u5982\uff0c\u5982\u679c\u67d0\u4e2a\u5c5e\u6027\u9650\u5236\u4e3a \uff0c\u5219\u7528\u6237\u65e0\u6cd5\u4ece Lightning \u8bb0\u5f55\u9875\u9762\u8bbe\u7f6e\u5176\u503c\u3002\u5982\u679c\u672a\u6307\u5b9a\u5c5e\u6027\uff0c\u5219\u9ed8\u8ba4\u503c\u5141\u8bb8\u8f93\u5165\u548c\u8f93\u51fa\u3002<code>inputOnly<\/code><code>outputOnly<\/code><code>role<\/code><code>outputOnly<\/code><code>role<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u8bf7\u53c2\u9605\u00a0XML \u914d\u7f6e\u6587\u4ef6\u5143\u7d20\u7684\u5b8c\u6574\u5217\u8868\u3002<\/p>\n\n\n\n<p>\u6b64\u793a\u4f8b\u7ec4\u4ef6\u6709 5 \u4e2a\u6d41\u5c4f\u5e55\u8f93\u5165\u5b57\u6bb5\u3002\u8be5\u5c5e\u6027\u8bbe\u7f6e\u4e3a \u3002<code>startDate<\/code><code>inputOnly<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;LightningComponentBundle xmlns=\"http:\/\/soap.sforce.com\/2006\/04\/metadata\"&gt;\n  &lt;apiVersion&gt;47.0&lt;\/apiVersion&gt;\n  &lt;isExposed&gt;true&lt;\/isExposed&gt;\n  &lt;masterLabel&gt;Best Component Ever&lt;\/masterLabel&gt;\n  &lt;description&gt;This is a demo component.&lt;\/description&gt;\n  &lt;targets&gt;\n    &lt;target&gt;lightning__FlowScreen&lt;\/target&gt;\n  &lt;\/targets&gt;\n  &lt;targetConfigs&gt;\n    &lt;targetConfig targets=\"lightning__FlowScreen\"&gt;\n      &lt;property name=\"startDate\" label=\"Start Date\" type=\"Date\" role=\"inputOnly\" \/&gt;\n      &lt;property name=\"account\" label=\"Account Chosen\" type=\"@salesforce\/schema\/Account\" \/&gt;\n      &lt;property name=\"annualRevenue\" label=\"Annual Revenue\" type=\"Integer\" role=\"outputOnly\" \/&gt;\n      &lt;property name=\"name\" label=\"Account Name\" type=\"String\" \/&gt;\n    &lt;\/targetConfig&gt;\n  &lt;\/targetConfigs&gt;\n&lt;\/LightningComponentBundle&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"validate-user-input-for-custom-flow-screen-components\">\u9a8c\u8bc1\u81ea\u5b9a\u4e49\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u7684\u7528\u6237\u8f93\u5165<\/h2>\n\n\n\n<p>\u5411\u81ea\u5b9a\u4e49\u5c4f\u5e55\u7ec4\u4ef6\u6dfb\u52a0\u9a8c\u8bc1\u3002<\/p>\n\n\n\n<p>\u8981\u4f7f\u7528 Flow \u7684\u9a8c\u8bc1\u529f\u80fd\uff0c\u8bf7\u5728\u7ec4\u4ef6\u7684 JavaScript \u6587\u4ef6\u4e2d\u521b\u5efa\u4e00\u4e2a\u8c03\u7528\u7684\u51fd\u6570\u3002<code>validate()<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ sampleValidate.js\n@api\nvalidate() {\n  if(\/* true conditions *\/) {\n    return { isValid: true };\n    }\n  else {\n    \/\/ If the component is invalid, return the isValid parameter\n    \/\/ as false and return an error message.\n    return {\n      isValid: false,\n      errorMessage: '\/*A message that explains what went wrong.*\/'\n    };\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u7bad\u5934\u51fd\u6570\u8868\u8fbe\u5f0f\u4e0d\u9002\u7528\u4e8e \u7684\u7ec4\u4ef6\u4e2d\u7684\u9a8c\u8bc1\u3002<code>target<\/code><code>lightning__FlowScreen<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"embed-a-flow-in-a-custom-lightning-web-component\">\u5728\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u4e2d\u5d4c\u5165\u6d41\u7a0b<\/h2>\n\n\n\n<p>\u5d4c\u5165\u6765\u81ea\u4efb\u4f55 Lightning Web \u7ec4\u4ef6\u7684\u5c4f\u5e55\u6d41\uff0c\u4ee5\u81ea\u5b9a\u4e49\u5b8c\u6210\u884c\u4e3a\u3001\u8bbe\u7f6e\u81ea\u5b9a\u4e49\u6837\u5f0f\u6216\u4ece Lightning Web \u7ec4\u4ef6\u542f\u52a8\u6d41\u7a0b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-and-start-a-flow-in-a-custom-lightning-web-component\">\u5728\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u4e2d\u521b\u5efa\u548c\u542f\u52a8\u6d41\u7a0b<\/h2>\n\n\n\n<p>\u521b\u5efa\u5e76\u542f\u52a8\u4ece\u4efb\u4f55 Lightning Web \u7ec4\u4ef6\u5230\u60a8\u7684\u5c4f\u5e55\u6d41\u3002<\/p>\n\n\n\n<p><code>lightning-flow<\/code>\u8868\u793a Lightning \u8fd0\u884c\u65f6\u4e2d\u7684\u6d41\u7a0b\u9762\u8bd5\u3002\u82e5\u8981\u5728\u7ec4\u4ef6\u4e2d\u521b\u5efa\u6d41\uff0c\u8bf7\u5c06\u7ec4\u4ef6\u7684\u5c5e\u6027\u8bbe\u7f6e\u4e3a\u8981\u4f7f\u7528\u7684\u6d41\u7684 API \u540d\u79f0\u3002\u8981\u4f7f\u7528\u6b64\u7ec4\u4ef6\uff0c\u8bf7\u5148\u4f7f\u7528 Salesforce Flow Builder \u6784\u5efa\u6d41\u7a0b\u3002\u8be5\u7ec4\u4ef6\u5305\u62ec\u5bfc\u822a\u6309\u94ae\u201c\u540e\u9000\u201d\u3001\u201c\u4e0b\u4e00\u6b65\u201d\u3001\u201c\u6682\u505c\u201d\u548c\u201c\u5b8c\u6210\u201d\u3002<code>lightning-flow<\/code><code>flow-api-name<\/code><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u6d41\u7a0b\u5177\u6709\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u6216 Aura \u7ec4\u4ef6\uff0c\u5219\u65e0\u6cd5\u5728\u4f7f\u7528 Lightning Web Runtime \u7684 Experience Cloud \u7ad9\u70b9\u4e0a\u4f7f\u7528\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f8b<\/h2>\n\n\n\n<p>\u6b64\u793a\u4f8b\u521b\u5efa\u5e76\u542f\u52a8\u201c\u8c03\u67e5\u5ba2\u6237\u201d\u6d41\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- myComponent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-flow flow-api-name=\"Survey_customers\"&gt; &lt;\/lightning-flow&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u5c06\u5c5e\u6027\u8bbe\u7f6e\u4e3a\u8f93\u5165\u503c\u6570\u7ec4\u6765\u63d0\u4f9b\u9762\u8bd5\u7684\u521d\u59cb\u8f93\u5165\u3002<code>flow-input-variables<\/code><\/p>\n\n\n\n<p>\u6b64\u793a\u4f8b\u901a\u8fc7\u4f20\u5165\u6d41\u7a0b\u7684\u521d\u59cb\u503c\u6765\u521b\u5efa\u548c\u542f\u52a8\u9762\u8bd5\u3002\u5b83\u4f7f\u7528\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u5904\u7406\u9762\u8bd5\u4e2d\u7684\u66f4\u6539\u3002<code>onstatuschange<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- myComponent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-flow\n    flow-api-name={flowName}\n    flow-input-variables={inputVariables}\n    onstatuschange={handleStatusChange}&gt;\n  &lt;\/lightning-flow&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nimport { LightningElement } from \"lwc\";\n\nexport default class MyComponent extends LightningElement {\n  opportunityId;\n  accountId;\n  customerLocation;\n\n  get flowName() {\n    if (this.customerLocation === \"USA\") {\n      flowname = \"Survey_USA\";\n    } else {\n      flowname = \"Survey_General\";\n    }\n  }\n\n  get inputVariables() {\n    return &#91;\n      {\n        \/\/ Match with the input variable name declared in the flow.\n        name: \"OpportunityID\",\n        type: \"String\",\n        \/\/ Initial value to send to the flow input.\n        value: this.opportunityId,\n      },\n      {\n        \/\/ Match with the input variable name declared in the flow.\n        name: \"AccountID\",\n        type: \"String\",\n        \/\/ Initial value to send to the flow input.\n        value: this.accountId,\n      },\n    ];\n  }\n\n  handleStatusChange(event) {\n    if (event.detail.status === \"FINISHED\") {\n      \/\/ set behavior after a finished flow interview.\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u6ce8\u610f\u4e8b\u9879<\/h2>\n\n\n\n<p>\u8be5\u7ec4\u4ef6\u4ec5\u652f\u6301\u8be5\u5c5e\u6027\u7684\u6d3b\u52a8\u6d41\u3002<code>lightning-flow<\/code><code>flow-api-name<\/code><\/p>\n\n\n\n<p>\u8be5\u4e8b\u4ef6\u8fd4\u56de\u8fd9\u4e9b\u53c2\u6570\u3002<code>onstatuschange<\/code><\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u6d41\u7a0b\u5177\u6709\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u6216 Aura \u7ec4\u4ef6\uff0c\u5219\u65e0\u6cd5\u5728\u4f7f\u7528 Lightning Web Runtime \u7684 Experience Cloud \u7ad9\u70b9\u4e0a\u4f7f\u7528\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u53c2\u6570<\/th><th>\u7c7b\u578b<\/th><th>\u63cf\u8ff0<\/th><\/tr><\/thead><tbody><tr><td>\u6d3b\u52a8\u9636\u6bb5<\/td><td>\u5bf9\u8c61[]<\/td><td>\u6d41\u4e2d&nbsp;<strong>$Flow.ActiveStages<\/strong>&nbsp;\u53d8\u91cf\u7684\u5f53\u524d\u503c\u3002\u5728 API \u7248\u672c 42.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u53ef\u7528\u3002<\/td><\/tr><tr><td>\u5f53\u524d\u9636\u6bb5<\/td><td>\u5bf9\u8c61<\/td><td>\u6d41\u4e2d&nbsp;<strong>$Flow.CurrentStage<\/strong>&nbsp;\u53d8\u91cf\u7684\u5f53\u524d\u503c\u3002\u5728 API \u7248\u672c 42.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u53ef\u7528\u3002<\/td><\/tr><tr><td>flowTitle \uff08\u6d41\u6807\u9898\uff09<\/td><td>\u5b57\u7b26\u4e32<\/td><td>\u6d41\u7684\u6807\u7b7e\u3002<\/td><\/tr><tr><td>\u5e2e\u52a9\u6587\u672c<\/td><td>\u5b57\u7b26\u4e32<\/td><td>\u5f53\u524d\u5c4f\u5e55\u7684\u5e2e\u52a9\u6587\u672c\u3002\u5728 API \u7248\u672c 42.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u53ef\u7528\u3002<\/td><\/tr><tr><td>GUID<\/td><td>\u5b57\u7b26\u4e32<\/td><td>\u9762\u8bd5\u7684 GUID\u3002\u5728 API \u7248\u672c 42.0 \u53ca\u66f4\u9ad8\u7248\u672c\u4e2d\u53ef\u7528\u3002<\/td><\/tr><tr><td>\u8f93\u51fa\u53d8\u91cf<\/td><td>\u5bf9\u8c61[]<\/td><td>\u6d41\u8f93\u51fa\u53d8\u91cf\u7684\u5f53\u524d\u503c\u3002<\/td><\/tr><tr><td>\u5730\u4f4d<\/td><td>\u5b57\u7b26\u4e32<\/td><td>\u9762\u8bd5\u7684\u72b6\u6001\u3002\u6d41\u7a0b\u9762\u8bd5\u7684\u6709\u6548\u72b6\u6001\u4e3a\uff1a<code>STARTED<\/code>\uff1a\u9762\u8bd5\u6210\u529f\u5f00\u59cb\u3002<code>PAUSED<\/code>\uff1a\u91c7\u8bbf\u6210\u529f\u6682\u505c\u3002<code>FINISHED<\/code>\uff1a\u5c4f\u5e55\u5b8c\u6210\u7684\u6d41\u7a0b\u9762\u8bd5\u3002<code>FINISHED_SCREEN:<\/code>\u6ca1\u6709\u5c4f\u5e55\u7684\u6d41\u7684\u9762\u8bd5\u5df2\u5b8c\u6210\uff0c\u7ec4\u4ef6\u663e\u793a\u9ed8\u8ba4\u5c4f\u5e55\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u6d88\u606f\uff1a\u60a8\u7684\u6d41\u5df2\u5b8c\u6210\u3002<code>ERROR<\/code>\uff1a\u51fa\u4e86\u70b9\u95ee\u9898\uff0c\u9762\u8bd5\u5931\u8d25\u4e86\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u5b9a\u4e49\u6d41\u7684\u5b8c\u6210\u884c\u4e3a<\/h2>\n\n\n\n<p>\u6bcf\u4e2a\u6d41\u7ec4\u4ef6\u90fd\u5305\u62ec\u5bfc\u822a\u6309\u94ae\u201c\u540e\u9000\u201d\u3001\u201c\u4e0b\u4e00\u6b65\u201d\u3001\u201c\u6682\u505c\u201d\u548c\u201c\u5b8c\u6210\u201d\uff0c\u8fd9\u4e9b\u6309\u94ae\u5728\u6d41\u4e2d\u5bfc\u822a\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5f53\u6d41\u7a0b\u5b8c\u6210\u65f6\uff0c\u7ec4\u4ef6\u4f1a\u91cd\u65b0\u52a0\u8f7d\u65b0\u9762\u8bd5\u7684\u7b2c\u4e00\u4e2a\u5c4f\u5e55\u3002\u82e5\u8981\u81ea\u5b9a\u4e49\u6d41\u7a0b\u5b8c\u6210\u65f6\u53d1\u751f\u7684\u60c5\u51b5\uff0c\u8bf7\u5728\u72b6\u6001\u4e3a FINISHED \u65f6\u4e3a\u64cd\u4f5c\u6dfb\u52a0\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u3002<code>onstatuschange<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-flow-input-variables\">\u8bbe\u7f6e\u6d41\u8f93\u5165\u53d8\u91cf<\/h2>\n\n\n\n<p>\u5728\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e2d\u5d4c\u5165\u6d41\u65f6\uff0c\u901a\u8fc7\u521d\u59cb\u5316\u6d41\u7684\u53d8\u91cf\u4e3a\u6d41\u63d0\u4f9b\u66f4\u591a\u4e0a\u4e0b\u6587\u3002\u82e5\u8981\u5728\u7ec4\u4ef6\u4e2d\u521b\u5efa\u6d41\uff0c\u8bf7\u5c06\u7ec4\u4ef6\u7684\u5c5e\u6027\u8bbe\u7f6e\u4e3a\u8981\u4f7f\u7528\u7684\u6d41\u7684 API \u540d\u79f0\u3002<code>lightning-flow<\/code><code>lightning-flow<\/code><code>flow-api-name<\/code><\/p>\n\n\n\n<p>\u8981\u4f7f\u7528\u6b64\u7ec4\u4ef6\uff0c\u8bf7\u5148\u4f7f\u7528 Salesforce Flow Builder \u6784\u5efa\u6d41\u7a0b\u3002\u8be5\u7ec4\u4ef6\u5305\u62ec\u5bfc\u822a\u6309\u94ae\u201c\u540e\u9000\u201d\u3001\u201c\u4e0b\u4e00\u6b65\u201d\u3001\u201c\u6682\u505c\u201d\u548c\u201c\u5b8c\u6210\u201d\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u6d41\u7a0b\u5177\u6709\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u6216 Aura \u7ec4\u4ef6\uff0c\u5219\u65e0\u6cd5\u5728\u4f7f\u7528 Lightning Web Runtime \u7684 Experience Cloud \u7ad9\u70b9\u4e0a\u4f7f\u7528\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e3a\u6d41\u521b\u5efa\u8f93\u5165\u53d8\u91cf<\/h2>\n\n\n\n<p>\u5728\u7ec4\u4ef6\u7684 Javascript \u6587\u4ef6\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u6620\u5c04\u5217\u8868\uff0c\u5e76\u5c06\u8be5\u5217\u8868\u4f20\u9012\u7ed9\u5c5e\u6027\u3002<code>flow-input-variables<\/code><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u60a8\u53ea\u80fd\u5728\u9762\u8bd5\u5f00\u59cb\u65f6\u8bbe\u7f6e\u53d8\u91cf\uff0c\u5e76\u4e14\u60a8\u8bbe\u7f6e\u7684\u53d8\u91cf\u5fc5\u987b\u5141\u8bb8\u8f93\u5165\u8bbf\u95ee\u3002\u5982\u679c\u5f15\u7528\u7684\u53d8\u91cf\u4e0d\u5141\u8bb8\u8f93\u5165\u8bbf\u95ee\uff0c\u5219\u4f1a\u5ffd\u7565\u8bbe\u7f6e\u8be5\u53d8\u91cf\u7684\u5c1d\u8bd5\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u60a8\u8bbe\u7f6e\u7684\u6bcf\u4e2a\u53d8\u91cf\uff0c\u8bf7\u63d0\u4f9b\u53d8\u91cf\u7684\u540d\u79f0\u3001\u7c7b\u578b\u548c\u503c\u3002\u5bf9\u4e8e type \uff08\u7c7b\u578b\uff09\uff0c\u8bf7\u4f7f\u7528 API \u540d\u79f0\u4f5c\u4e3a\u6d41\u6570\u636e\u7c7b\u578b\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u8bb0\u5f55\u53d8\u91cf\uff0c\u8bf7\u4f7f\u7528&nbsp;<strong>SObject<\/strong>\uff0c\u5bf9\u4e8e\u6587\u672c\u53d8\u91cf\uff0c\u8bf7\u4f7f\u7528 String\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  name : \"varName\",\n  type : \"flowDataType\",\n  value : valueToSet\n},\n{\n  name : \"varName\",\n  type : \"flowDataType\",\n  value : &#91; value1, value2 ]\n}, ...<\/code><\/pre>\n\n\n\n<p>JavaScript \u6587\u4ef6\u4e2d\u7684\u6b64\u65b9\u6cd5\u8fd4\u56de\u4e00\u4e2a\u6570\u5b57\u53d8\u91cf\u3001\u4e00\u4e2a\u65e5\u671f\u96c6\u5408\u53d8\u91cf\u548c\u51e0\u4e2a\u8bb0\u5f55\u53d8\u91cf\u7684\u503c\u6570\u7ec4\u3002Flow Builder \u4e2d\u7684 Record \u6570\u636e\u7c7b\u578b\u4e0e\u6b64\u5904\u7684&nbsp;<strong>SObject<\/strong>&nbsp;\u76f8\u5bf9\u5e94\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nget inputVariables() {\n  return &#91;\n    { name: 'numVar', type: 'Number', value: 30 },\n    { name: 'dateColl', type: 'String', value: &#91; '2016-10-27', '2017-08-01' ] },\n    \/\/ Sets values for fields in the account record (sObject) variable.\n    \/\/ Id uses the value of the accountId property. Rating uses a string.\n    { name: 'account', type: 'SObject', value: {\n      'Id': this.accountId,\n      'Rating': 'Warm'\n    }},\n    \/\/ Set the contact record (sObject) variable to the value of the contact property.\n    \/\/ We're assuming the property contains the entire sObject for a contact record.\n    { name: 'contact', type: 'SObject', value: this.contact }\n  ]\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u5c06\u5e10\u6237\u6570\u636e\u4f20\u9012\u5230\u6d41<\/h2>\n\n\n\n<p>\u6b64\u793a\u4f8b\u7ec4\u4ef6\u901a\u8fc7 Apex \u63a7\u5236\u5668\u83b7\u53d6\u5e10\u6237\u3002Apex \u63a7\u5236\u5668\u901a\u8fc7 JavaScript \u6587\u4ef6\u4e2d\u7684\u7ebf\u8def\u5c06\u6570\u636e\u4f20\u9012\u5230\u6d41\u7684\u8bb0\u5f55\u53d8\u91cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- myComponent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-flow flow-api-name=\"myFlow\" flow-input-variables={inputVariables}&gt; &lt;\/lightning-flow&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ AccountController.apex\npublic with sharing class AccountController {\n    @AuraEnabled(cacheable=true)\n    public static Account getAccount() {\n        return &#91;SELECT Id, Name, LastModifiedDate, FROM Account LIMIT 1];\n    }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nimport { LightningElement, track, wire } from \"lwc\";\nimport getAccount from \"@salesforce\/apex\/AccountController.getAccount\";\n\nexport default class MyComponent extends LightningElement {\n  @track\n  inputVariables = &#91;];\n\n  @wire(getAccount)\n  getAccountFromApex({ error, data }) {\n    if (error) {\n      console.log(\"Failed to get account data.\");\n    } else if (data) {\n      this.inputVariables = &#91;\n        {\n          name: \"account\",\n          type: \"SOjbect\",\n          value: data,\n        },\n      ];\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"get-values-from-flow-output-variables\">\u4ece\u6d41\u8f93\u51fa\u53d8\u91cf\u4e2d\u83b7\u53d6\u503c<\/h2>\n\n\n\n<p>\u5728\u7ec4\u4ef6\u4e2d\u5d4c\u5165\u6d41\u65f6\uff0c\u53ef\u4ee5\u663e\u793a\u6216\u5f15\u7528\u6d41\u7684\u53d8\u91cf\u503c\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<p>\u8981\u4f7f\u7528\u6b64\u7ec4\u4ef6\uff0c\u8bf7\u5148\u4f7f\u7528 Salesforce Flow Builder \u6784\u5efa\u6d41\u7a0b\u3002\u8be5\u7ec4\u4ef6\u5305\u62ec\u5bfc\u822a\u6309\u94ae\u201c\u540e\u9000\u201d\u3001\u201c\u4e0b\u4e00\u6b65\u201d\u3001\u201c\u6682\u505c\u201d\u548c\u201c\u5b8c\u6210\u201d\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u6d41\u7a0b\u5177\u6709\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u6216 Aura \u7ec4\u4ef6\uff0c\u5219\u65e0\u6cd5\u5728\u4f7f\u7528 Lightning Web Runtime \u7684 Experience Cloud \u7ad9\u70b9\u4e0a\u4f7f\u7528\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528 onstatuschange \u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f<\/h2>\n\n\n\n<p>\u82e5\u8981\u4ece\u6d41\u7684\u8f93\u51fa\u53d8\u91cf\u4e2d\u83b7\u53d6\u503c\uff0c\u8bf7\u4f7f\u7528\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u3002\u8f93\u51fa\u53d8\u91cf\u4ee5\u6570\u7ec4\u5f62\u5f0f\u8fd4\u56de\u3002\u8be5\u53d8\u91cf\u5fc5\u987b\u5141\u8bb8\u8f93\u51fa\u8bbf\u95ee\u3002\u5982\u679c\u5f15\u7528\u7684\u53d8\u91cf\u4e0d\u5141\u8bb8\u8f93\u51fa\u8bbf\u95ee\uff0c\u5219\u4f1a\u5ffd\u7565\u83b7\u53d6\u8be5\u53d8\u91cf\u7684\u5c1d\u8bd5\u3002<code>onstatuschange<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u663e\u793a\u6d41\u7684\u8f93\u51fa\u53d8\u91cf<\/h2>\n\n\n\n<p>\u6b64\u793a\u4f8b\u83b7\u53d6 \u548c \u7684\u6d41\u8f93\u51fa\u53d8\u91cf\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u6a21\u677f\u4e2d\u3002<code>accountName<\/code><code>numberOfEmployees<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- myComponent.html --&gt;\n&lt;template&gt;\n  &lt;p&gt;{accountName}&lt;\/p&gt;\n  &lt;p&gt;{numberOfEmployees}&lt;\/p&gt;\n  &lt;lightning-flow flow-api-name=\"myFlow\" onstatuschange={handleStatusChange}&gt; &lt;\/lightning-flow&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nimport { LightningElement, track, wire } from \"lwc\";\n\nexport default class MyComponent extends LightningElement {\n  accountName;\n  numberOfEmployees;\n\n  handleStatusChange(event) {\n    if (event.detail.status === \"FINISHED\") {\n      const outputVariables = event.detail.outputVariables;\n      for (let i = 0; i &lt; outputVariables.length; i++) {\n        const outputVar = outputVariables&#91;i];\n        if (outputVar.name == \"accountName\") {\n          this.accountName = outputVar.value;\n        } else {\n          this.numberOfEmployees = outputVar.value;\n        }\n      }\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"control-what-happens-when-a-flow-interview-finishes\">\u63a7\u5236\u6d41\u7a0b\u9762\u8bd5\u5b8c\u6210\u540e\u53d1\u751f\u7684\u60c5\u51b5<\/h2>\n\n\n\n<p>\u901a\u8fc7\u5c06\u6d41\u5d4c\u5165\u5230\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u786e\u5b9a\u6d41\u5b8c\u6210\u65f6\u53d1\u751f\u7684\u60c5\u51b5\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<p>\u8981\u4f7f\u7528\u6b64\u7ec4\u4ef6\uff0c\u8bf7\u5148\u4f7f\u7528 Salesforce Flow Builder \u6784\u5efa\u6d41\u7a0b\u3002\u8be5\u7ec4\u4ef6\u5305\u62ec\u5bfc\u822a\u6309\u94ae\u201c\u540e\u9000\u201d\u3001\u201c\u4e0b\u4e00\u6b65\u201d\u3001\u201c\u6682\u505c\u201d\u548c\u201c\u5b8c\u6210\u201d\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u6d41\u7a0b\u5177\u6709\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u6216 Aura \u7ec4\u4ef6\uff0c\u5219\u65e0\u6cd5\u5728\u4f7f\u7528 Lightning Web Runtime \u7684 Experience Cloud \u7ad9\u70b9\u4e0a\u4f7f\u7528\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528 lightning-flow \u5d4c\u5165\u6d41<\/h2>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5f53\u6d41\u7a0b\u7528\u6237\u5355\u51fb\u201c\u5b8c\u6210\u201d\u65f6\uff0c\u5c06\u5f00\u59cb\u65b0\u7684\u9762\u8bd5\uff0c\u5e76\u4e14\u7528\u6237\u5c06\u518d\u6b21\u770b\u5230\u6d41\u7a0b\u7684\u7b2c\u4e00\u4e2a\u5c4f\u5e55\u3002\u901a\u8fc7\u5c06\u6d41\u5d4c\u5165\u5230\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u6765\u8c03\u6574\u6d41\u5b8c\u6210\u65f6\u53d1\u751f\u7684\u60c5\u51b5\u3002<code>lightning-flow<\/code><code>onstatuschange<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u82e5\u8981\u91cd\u5b9a\u5411\u5230\u5176\u4ed6\u9875\u9762\uff0c\u8bf7\u4f7f\u7528\u5bfc\u822a\u670d\u52a1\u3002<\/li>\n\n\n\n<li>\u8981\u63a7\u5236\u81ea\u52a8\u542f\u52a8\u7684\u6d41\u7a0b\u5b8c\u6210\u65f6\u53d1\u751f\u7684\u60c5\u51b5\uff0c\u8bf7\u68c0\u67e5FINISHED_SCREEN\u72b6\u6001\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- myComponent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-flow flow-api-name=\"myFlow\" onstatuschange={handleStatusChange}&gt; &lt;\/lightning-flow&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nhandleStatusChange(event) {\n    if(event.detail.status === 'FINISHED') {\n        \/\/ Redirect to another page in Salesforce., or\n        \/\/ Redirect to a page outside of Salesforce., or\n        \/\/ Show a toast, or something else\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u5728\u6d41\u7a0b\u5b8c\u6210\u540e\u5bfc\u822a\u5230\u8bb0\u5f55<\/h2>\n\n\n\n<p>\u6b64\u793a\u4f8b\u4f7f\u7528\u8be5<strong>\u65b9\u6cd5<\/strong>\u5c06\u7528\u6237\u91cd\u5b9a\u5411\u5230\u5728\u6d41\u4e2d\u521b\u5efa\u7684\u6848\u4f8b\u3002<code> lightning\/navigation<\/code><code>NavigationMixin.Navigate<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nimport { LightningElement } from \"lwc\";\nimport { NavigationMixin } from \"lightning\/navigation\";\n\nexport default class MyComponent extends NavigationMixin(LightningElement) {\n  navigateToRecord(recordId) {\n    this&#91;NavigationMixin.Navigate]({\n      type: \"standard__recordPage\",\n      attributes: {\n        recordId,\n        actionName: \"view\",\n      },\n    });\n  }\n\n  handleStatusChange(event) {\n    if (event.detail.status === \"FINISHED\") {\n      const outputVariables = event.detail.outputVariables;\n      for (let i = 0; i &lt; outputVariables.length; i++) {\n        const outputVar = outputVariables&#91;i];\n        if (outputVar.name === \"redirect\") {\n          this.navigateToRecord(outputVar.value);\n        }\n      }\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"resume-a-flow-interview\">\u6062\u590d\u6d41\u7a0b\u9762\u8bd5<\/h2>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u5c06\u7ec4\u4ef6\u5d4c\u5165\u5230\u81ea\u5b9a\u4e49 LWC \u7ec4\u4ef6\u4e2d\u6765\u81ea\u5b9a\u4e49\u7528\u6237\u6062\u590d\u8bbf\u8c08\u7684\u65b9\u5f0f\u548c\u4f4d\u7f6e\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<p>\u8981\u4f7f\u7528\u6b64\u7ec4\u4ef6\uff0c\u8bf7\u5148\u4f7f\u7528 Salesforce Flow Builder \u6784\u5efa\u6d41\u7a0b\u3002\u8be5\u7ec4\u4ef6\u5305\u62ec\u5bfc\u822a\u6309\u94ae\u201c\u540e\u9000\u201d\u3001\u201c\u4e0b\u4e00\u6b65\u201d\u3001\u201c\u6682\u505c\u201d\u548c\u201c\u5b8c\u6210\u201d\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u7684\u6d41\u7a0b\u5177\u6709\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u6216 Aura \u7ec4\u4ef6\uff0c\u5219\u65e0\u6cd5\u5728\u4f7f\u7528 Lightning Web Runtime \u7684 Experience Cloud \u7ad9\u70b9\u4e0a\u4f7f\u7528\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5904\u7406\u6682\u505c\u7684\u9762\u8bd5<\/h2>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u7528\u6237\u53ef\u4ee5\u4ece\u5176\u4e3b\u9875\u4e0a\u7684\u201c\u6682\u505c\u7684\u8bbf\u8c08\u201d\u7ec4\u4ef6\u4e2d\u6062\u590d\u4ed6\u4eec\u6682\u505c\u7684\u8bbf\u8c08\u3002\u82e5\u8981\u81ea\u5b9a\u4e49\u7528\u6237\u6062\u590d\u8bbf\u8c08\u7684\u65b9\u5f0f\u548c\u4f4d\u7f6e\uff0c\u8bf7\u5c06\u7ec4\u4ef6\u5d4c\u5165\u5230\u81ea\u5b9a\u4e49 LWC \u7ec4\u4ef6\u4e2d\uff0c\u5e76\u5c06\u8bbf\u8c08 ID \u4f20\u9012\u5230\u5c5e\u6027\u4e2d\u3002<code>lightning-flow<\/code><code>flow-interview-id<\/code><\/p>\n\n\n\n<p>\u6b64\u793a\u4f8b\u8bf4\u660e\u5982\u4f55\u6062\u590d\u9762\u8bd5\u6216\u5f00\u59cb\u65b0\u7684\u9762\u8bd5\u3002\u5f53\u7528\u6237\u5355\u51fb\u8054\u7cfb\u4eba\u8bb0\u5f55\u4e2d\u7684\u201c\u8c03\u67e5\u5ba2\u6237\u201d\u65f6\uff0c\u8be5\u7ec4\u4ef6\u5c06\u6267\u884c\u5176\u4e2d\u4e00\u9879\u64cd\u4f5c\u3002<code>lightning-flow<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c\u7528\u6237\u5bf9\u201c\u8c03\u67e5\u5ba2\u6237\u201d\u6d41\u6709\u4efb\u4f55\u6682\u505c\u7684\u8bbf\u8c08\uff0c\u5219\u8be5\u7ec4\u4ef6\u5c06\u6062\u590d\u7b2c\u4e00\u4e2a\u8bbf\u8c08\u3002<code>lightning-flow<\/code><\/li>\n\n\n\n<li>\u5982\u679c\u7528\u6237\u5bf9\u8c03\u67e5\u5ba2\u6237\u6d41\u6ca1\u6709\u4efb\u4f55\u6682\u505c\u7684\u8bbf\u8c08\uff0c\u5219\u8be5\u7ec4\u4ef6\u5c06\u542f\u52a8\u4e00\u4e2a\u65b0\u8bbf\u8c08\u3002<code>lightning-flow<\/code><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- myComponent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-flow flow-api-name={flowName} flow-interview-id={pausedInterviewId}&gt;\n  &lt;\/lightning-flow&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u4f7f\u7528 Apex \u6062\u590d\u6216\u5f00\u59cb\u65b0\u7684\u9762\u8bd5<\/h2>\n\n\n\n<p>\u6b64 Apex \u63a7\u5236\u5668\u901a\u8fc7\u6267\u884c SOQL \u67e5\u8be2\u6765\u83b7\u53d6\u6682\u505c\u8bbf\u8c08\u7684\u5217\u8868\u3002\u5982\u679c\u6ca1\u6709\u6682\u505c\u7684\u8bbf\u8c08\uff0c\u5219\u67e5\u8be2\u5c06\u8fd4\u56de null \u503c\uff0c\u7136\u540e\u7ec4\u4ef6\u5c06\u542f\u52a8\u65b0\u7684\u8bbf\u8c08\u3002\u5982\u679c\u67e5\u8be2\u8fd4\u56de\u81f3\u5c11\u4e00\u4e2a\u91c7\u8bbf\uff0c\u5219\u8be5\u7ec4\u4ef6\u5c06\u6062\u590d\u8be5\u5217\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u91c7\u8bbf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ InterviewsController.apex\npublic class InterviewsController {\n    @AuraEnabled(cacheable=true)\n    public static String getPausedId() {\n        \/\/ Get the ID of the running user.\n        String currentUser = UserInfo.getUserId();\n        \/\/ Find all of that user\u2019s paused interviews for the Survey customers flow.\n        List&lt;FlowInterview&gt; interviews =\n             &#91; SELECT Id FROM FlowInterview WHERE CreatedById = :currentUser AND\n                 InterviewLabel LIKE '%Survey customers%'];\n        if (interviews == null || interviews.isEmpty()) {\n            return null; \/\/ early out\n        }\n        \/\/ Return the ID for the first interview in the list.\n        return interviews.get(0).Id;\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u5982\u679c Apex \u63a7\u5236\u5668\u8fd4\u56de\u91c7\u8bbf ID\uff0c\u5219\u4f20\u9012\u5230\u8be5\u5c5e\u6027\u3002\u5982\u679c Apex \u63a7\u5236\u5668\u8fd4\u56de\u7a7a\u8bbf\u8c08 ID\uff0c\u5219\u7ec4\u4ef6\u901a\u8fc7\u5c06\u6d41\u540d\u79f0\u4f20\u9012\u7ed9\u5c5e\u6027\u6765\u542f\u52a8\u65b0\u7684\u8bbf\u8c08\u3002<code>pausedInterviewId<\/code><code>flow-interview-id<\/code><code>flow-api-name<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nimport { LightningElement, wire } from \"lwc\";\nimport getPausedId from \"@salesforce\/apex\/InterviewsController.getPausedId\";\n\nexport default class MyComponent extends LightningElement {\n  flowName;\n  pausedInterviewId;\n\n  @wire(getPausedId)\n  getPausedInterviewId({ error, data }) {\n    if (error) {\n      \/\/ start a new interview since no interview id was returned.\n      this.flowName = \"Survey_customers\";\n    } else if (data) {\n      \/\/ resume the flow with the returned interview id.\n      this.pausedInterviewId = data;\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"runtime-considerations-for-flow-screen-components\">\u6d41\u5c4f\u7ec4\u4ef6\u7684\u8fd0\u884c\u65f6\u6ce8\u610f\u4e8b\u9879<\/h2>\n\n\n\n<p>\u4e3a\u6d41\u7a0b\u914d\u7f6e\u7ec4\u4ef6\u65f6\uff0c\u8bf7\u67e5\u770b\u8fd9\u4e9b\u6ce8\u610f\u4e8b\u9879\uff0c\u4ee5\u5b9a\u4e49\u5c5e\u6027\u548c\u6d41\u7a0b\u8fd0\u884c\u65f6\u884c\u4e3a\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5904\u7406&nbsp;<code>null<\/code>&nbsp;\u9ed8\u8ba4\u8f93\u5165\u503c\u3002<\/strong>\u5982\u679c\u6d41\u7a0b\u7ba1\u7406\u5458\u672a\u4e3a\u81ea\u5b9a\u4e49\u5c4f\u5e55\u7ec4\u4ef6\u8bbe\u7f6e\u9ed8\u8ba4\u8f93\u5165\u503c\uff0c\u5219\u6d41\u7a0b\u751f\u6210\u5668\u4f1a\u5728\u7ec4\u4ef6\u8fd0\u884c\u65f6\u4f20\u9012\u4e00\u4e2a\u503c\u3002\u82e5\u8981\u5728\u8fd0\u884c\u65f6\u8bbe\u7f6e\u9ed8\u8ba4\u503c\uff0c\u8bf7\u6dfb\u52a0\u5904\u7406\u7a0b\u5e8f\u3002<code>null<\/code><code>null<\/code><\/li>\n\n\n\n<li><strong>\u901a\u77e5\u8fd0\u884c\u65f6\u5c5e\u6027\u66f4\u6539\u3002<\/strong>Lightning Web \u7ec4\u4ef6\u4f7f\u7528\u4e8b\u4ef6\u6765\u62a5\u544a\u4ece\u7ec4\u4ef6\u5230\u6d41\u7a0b\u7684\u66f4\u6539\u3002\u4e3a\u4e86\u901a\u77e5\u6d41\u8fd0\u884c\u65f6\u5c5e\u6027\u66f4\u6539\uff0c\u7ec4\u4ef6\u4f1a\u89e6\u53d1\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c\u5728\u6ee1\u8db3\u6761\u4ef6\u65f6\u4f7f\u7528\u6761\u4ef6\u53ef\u89c1\u6027\u5448\u73b0\u5c4f\u5e55\u7ec4\u4ef6\u65f6\uff0c\u6216\u8005\u5c06\u8f93\u51fa\u5c5e\u6027\u7684\u503c\u6620\u5c04\u5230\u6d41\u53d8\u91cf\u65f6\uff0c\u8bf7\u4f7f\u7528\u6b64\u4e8b\u4ef6\u3002\u6709\u5173\u4ee3\u7801\u793a\u4f8b\uff0c\u8bf7\u53c2\u89c1\u3002<code>FlowAttributeChangeEvent<\/code><code>lightning-flow-support<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-up-your-screen-flow-components-for-reactivity\">\u8bbe\u7f6e\u5c4f\u5e55\u6d41\u7ec4\u4ef6\u7684\u53cd\u5e94\u6027<\/h2>\n\n\n\n<p>\u5c4f\u5e55\u6d41\u53cd\u5e94\u6027\u610f\u5473\u7740\u4f7f\u5c4f\u5e55\u6d41\u7ec4\u4ef6\u66f4\u6539\u5f71\u54cd\u53e6\u4e00\u4e2a\u540c\u4e00\u5c4f\u5e55\u7ec4\u4ef6\u3002<\/p>\n\n\n\n<p>\u5728 Flow \u6784\u5efa\u5668\u4e2d\u6dfb\u52a0\u548c\u914d\u7f6e\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u4e4b\u524d\uff0c\u8bf7\u521b\u5efa\u81ea\u5b9a\u4e49 LWC\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u8ba1\u5212\u6784\u5efa\u53cd\u5e94\u5f0f\u5c4f\u5e55\u7ec4\u4ef6\u6216\u4f7f\u7528\u652f\u6301\u7684\u7ec4\u4ef6\uff0c\u5219\u9700\u8981\u4e86\u89e3\u6bcf\u4e2a\u7ec4\u4ef6\u7684\u6ce8\u610f\u4e8b\u9879\u3002\u53cd\u5e94\u6027\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u786e\u5b9a\u54ea\u4e2a\u5c4f\u5e55\u7ec4\u4ef6\u662f\u6e90\uff0c\u54ea\u4e2a\u7ec4\u4ef6\u662f\u53cd\u5e94\u5f0f\u7ec4\u4ef6\u3002<\/li>\n\n\n\n<li>\u4e86\u89e3\u6bcf\u7ec4\u7ec4\u4ef6\u7684\u4e0d\u540c\u4ea4\u4e92\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example:-standard-flow-component-to-standard-flow-component\">\u793a\u4f8b\uff1a\u6807\u51c6\u6d41\u91cf\u7ec4\u4ef6\u5230\u6807\u51c6\u6d41\u91cf\u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u4f7f\u7528\u6807\u51c6 Flow \u7ec4\u4ef6\u662f\u5b9e\u73b0\u53cd\u5e94\u6027\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u6807\u51c6 Flow \u7ec4\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6dfb\u52a0\u7ec4\u4ef6\uff0c\u4e3a\u6bcf\u4e2a\u7ec4\u4ef6\u63d0\u4f9b API \u540d\u79f0\u548c\u6807\u7b7e\uff08\u5982\u679c\u9700\u8981\uff09\uff0c\u6807\u8bc6\u6e90\u548c\u53cd\u5e94\u5f0f\u7ec4\u4ef6\uff0c\u7136\u540e\u4fdd\u5b58\u5e76\u8fd0\u884c\u6d41\u3002<\/p>\n\n\n\n<p>\u8981\u4f7f Name \u7ec4\u4ef6\u7684 First Name \u5b57\u6bb5\u54cd\u5e94\u5e76\u663e\u793a\u6765\u81ea Text \u7ec4\u4ef6\u7684\u6240\u6709\u6587\u672c\u8f93\u5165\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728\u6d41\u7a0b\u4e2d\uff0c\u6dfb\u52a0\u7ec4\u4ef6\u548c\u7ec4\u4ef6\uff0c\u5e76\u4e3a\u6bcf\u4e2a\u7ec4\u4ef6\u63d0\u4f9b\u6807\u7b7e\u3002<code>Text<\/code><code>Name<\/code><\/li>\n\n\n\n<li>\u5728\u7ec4\u4ef6\u7684 First Name&#8217;s source \u5b57\u6bb5\u4e2d\uff0c\u9009\u62e9\u7ec4\u4ef6\u4f5c\u4e3a\u6e90\u3002\u6e90\u53ef\u4ee5\u662f\u540c\u4e00\u7c7b\u578b\u7684\u4efb\u4f55\u7ec4\u4ef6\uff0c\u5728\u672c\u4f8b\u4e2d\uff0cText \u7ec4\u4ef6\u7684\u7c7b\u578b\u548c Name \u7ec4\u4ef6\u7684 First Name \u5b57\u6bb5\u7684\u7c7b\u578b\u4e3a String\u3002<code>Name<\/code><code>Text<\/code><\/li>\n\n\n\n<li>\u4fdd\u5b58\u5e76\u8fd0\u884c Flow\uff0c\u7136\u540e\u5728\u7ec4\u4ef6\u7684\u8f93\u5165\u4e2d\u952e\u5165 .\u952e\u5165\u6bcf\u4e2a\u5b57\u7b26\u540e\uff0c\u201c\u540d\u5b57\u201d\u5b57\u6bb5\u4f1a\u7acb\u5373\u66f4\u65b0\u3002<code>Text<\/code><code>This is Reactivity<\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example:-standard-flow-component-to-custom-lightning-web-component\">\u793a\u4f8b\uff1a\u6807\u51c6\u6d41\u7ec4\u4ef6\u5230\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u8ba9\u60a8\u7684\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u5bf9\u6807\u51c6 Flow \u7ec4\u4ef6\u4e2d\u7684\u66f4\u6539\u505a\u51fa\u53cd\u5e94\u3002<\/p>\n\n\n\n<p>\u8981\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u5e76\u5c06\u5176\u6dfb\u52a0\u5230 Flow Builder \u4e2d\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a<code>colorName<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6dfb\u52a0\u201c\u6587\u672c\u201d\u7ec4\u4ef6\u548c\u201c\u81ea\u5b9a\u4e49\u201d\u7ec4\u4ef6\uff0c\u5e76\u4e3a\u6bcf\u4e2a\u7ec4\u4ef6\u63d0\u4f9b\u6807\u7b7e\u3002<code>colorName<\/code><\/li>\n\n\n\n<li>\u5728 colorName \u7684\u5c5e\u6027\u4e2d\uff0c\u9009\u62e9\u7ec4\u4ef6\u4f5c\u4e3a\u201c\u989c\u8272\u540d\u79f0\u201d\u5b57\u6bb5\u7684\u6e90\u3002<code>Text<\/code><\/li>\n<\/ol>\n\n\n\n<p>\u5bf9\u6587\u672c\u8f93\u5165\u6240\u505a\u7684\u4efb\u4f55\u66f4\u6539\u90fd\u4f1a\u81ea\u52a8\u53cd\u6620\u5728\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6 .\u4f8b\u5982\uff0c\u5728\u6587\u672c\u8f93\u5165\u4e2d\u8f93\u5165\u6d0b\u7ea2\u8272\u4f1a\u5bfc\u81f4 LWC \u663e\u793a\u5177\u6709\u76f8\u540c\u989c\u8272 magenta \u6837\u5f0f\u7684\u989c\u8272\u540d\u79f0\u3002<code>colorName<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- colorName.html --&gt;\n&lt;template&gt;\n  &lt;p&gt;\n    Color name has the same color :\n    &lt;span style={colorStyle}&gt;{color}&lt;\/span&gt;\n  &lt;\/p&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ colorName.js\nimport { LightningElement, api } from \"lwc\";\n\nexport default class colorName extends LightningElement {\n  @api color;\n\n  get colorStyle() {\n    return \"color:\" + this.color;\n  }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ colorName.js-meta.xml\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;LightningComponentBundle xmlns=\"http:\/\/soap.sforce.com\/2006\/04\/metadata\"&gt;\n &lt;apiVersion&gt;52.0&lt;\/apiVersion&gt;\n &lt;isExposed&gt;true&lt;\/isExposed&gt;\n &lt;masterLabel&gt;Color Name&lt;\/masterLabel&gt;\n &lt;description&gt;Reactive Color Name&lt;\/description&gt;\n &lt;targets&gt;\n     &lt;target&gt;lightning__FlowScreen&lt;\/target&gt;\n &lt;\/targets&gt;\n&lt;targetConfigs&gt;\n      &lt;targetConfig targets=\"lightning__FlowScreen\"&gt;\n          &lt;property name=\"color\" label=\"Name of Color\" type=\"String\" \/&gt;\n      &lt;\/targetConfig&gt;\n&lt;\/targetConfigs&gt;\n&lt;\/LightningComponentBundle&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example:-custom-lightning-web-component-to-standard-flow-component\">\u793a\u4f8b\uff1a\u5c06 Lightning Web \u7ec4\u4ef6\u81ea\u5b9a\u4e49\u4e3a\u6807\u51c6\u6d41\u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u4f7f\u81ea\u5b9a\u4e49\u6587\u672c\u7ec4\u4ef6\u5bf9\u6807\u51c6 Flow \u7ec4\u4ef6\u505a\u51fa\u53cd\u5e94\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528\u793a\u4f8b\u4e2d\u5f15\u7528\u7684\u88c5\u9970\u5668\u521b\u5efa\u516c\u5171\u5b57\u6bb5\u3002<code>@api<\/code><code>customText.js<\/code><\/li>\n\n\n\n<li>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u5177\u6709\u793a\u4f8b\u4e2d\u5f15\u7528\u7684\u9002\u5f53\u7c7b\u578b\u7684\u76ee\u6807\u914d\u7f6e\u3002<code>.js-meta.xml<\/code><code>customText.js-meta.xml<\/code><\/li>\n\n\n\n<li>\u6dfb\u52a0\u9644\u52a0\u4e86\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u7684\u8f93\u5165\u5b57\u6bb5\u4ee5\u5b58\u50a8\u7528\u6237\u8f93\u5165\u3002<\/li>\n\n\n\n<li>\u5728\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u4e2d\uff0c\u89e6\u53d1\u7ec4\u4ef6\u4e2d\u5b9a\u4e49\u7684\u4e8b\u4ef6\u3002\u4e8b\u4ef6\u540d\u79f0\u5fc5\u987b\u4e0e\u516c\u5171\u5b57\u6bb5\u7684\u540d\u79f0\u5339\u914d\uff0c\u624d\u80fd\u4f7f\u53cd\u5e94\u6027\u8d77\u4f5c\u7528\u3002\u7531\u4e8e Flow Runtime \u7684\u6027\u8d28\uff0csetter \u65b9\u6cd5\u5728\u89e6\u53d1\u4e8b\u4ef6\u540e\u8c03\u7528\uff0c\u5e76\u5728\u53cd\u5e94\u6027\u5bfc\u81f4\u5bf9\u516c\u5171\u5b57\u6bb5\u7684\u66f4\u6539\u65f6\u8c03\u7528\u8be5\u65b9\u6cd5\u3002<code>FlowAttributeChange<\/code><code>flow-support<\/code><code>FlowAttributeChange<\/code><code>FlowAttributeChange<\/code><\/li>\n\n\n\n<li>\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u540e\uff0c\u5c06\u8be5\u7ec4\u4ef6\u6dfb\u52a0\u5230\u5e26\u6709\u6807\u7b7e\u7684 Flow \u6784\u5efa\u5668\u4e2d\u3002<\/li>\n\n\n\n<li>\u82e5\u8981\u4f7f Text \u7ec4\u4ef6\u5bf9\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u505a\u51fa\u53cd\u5e94\uff0c\u8bf7\u5c06 Text \u7ec4\u4ef6\u4e0a\u7684\u9ed8\u8ba4\u503c\u6e90\u914d\u7f6e\u4e3a\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u7684\u516c\u5171\u5c5e\u6027\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- customText.html --&gt;\n&lt;template&gt;\n  &lt;lightning-input type=\"text\" label=\"This is custom text\" onchange={handleInputChange}&gt;\n  &lt;\/lightning-input&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ customText.js\nimport LightningElement, api, track } from 'lwc';\nimport { FlowAttributeChangeEvent } from 'lightning\/flowSupport';\n\nexport default class customText extends LightningElement {\n   @track _input;\n\n   @api\n   set customTextValue(input) {\n       if (input) {\n           this._input = input;\n       }\n   };\n   get customTextValue() {\n       return this._input;\n   }\n\n   handleInputChange(event) {\n       const attributeChangeEvent = new FlowAttributeChangeEvent('customTextValue', event.target.value);\n       this.dispatchEvent(attributeChangeEvent);\n   }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ customText.js-meta.xml\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;LightningComponentBundle xmlns=\"http:\/\/soap.sforce.com\/2006\/04\/metadata\"&gt;\n &lt;apiVersion&gt;52.0&lt;\/apiVersion&gt;\n &lt;isExposed&gt;true&lt;\/isExposed&gt;\n &lt;masterLabel&gt;Custom Text&lt;\/masterLabel&gt;\n &lt;description&gt;Custom Text Example&lt;\/description&gt;\n &lt;targets&gt;\n     &lt;target&gt;lightning__FlowScreen&lt;\/target&gt;\n &lt;\/targets&gt;\n&lt;targetConfigs&gt;\n      &lt;targetConfig targets=\"lightning__FlowScreen\"&gt;\n          &lt;property name=\"customTextValue\" label=\"Custom Text Value\" type=\"String\" \/&gt;\n      &lt;\/targetConfig&gt;\n&lt;\/targetConfigs&gt;\n&lt;\/LightningComponentBundle&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example:-custom-lightning-web-component-to-custom-lightning-web-component\">\u793a\u4f8b\uff1a\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u5230\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u4f7f\u81ea\u5b9a\u4e49 Lightning Web \u7ec4\u4ef6\u5bf9\u53e6\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u505a\u51fa\u53cd\u5e94\u3002<\/p>\n\n\n\n<p>\u6b64\u793a\u4f8b\u5047\u5b9a\u7ec4\u4ef6\u548c\u7ec4\u4ef6\u90fd\u5df2\u6dfb\u52a0\u5230 Flow Builder \u4e2d\u3002\u8be5\u7ec4\u4ef6\u7528\u4e8e\u63a7\u5236\u7ec4\u4ef6\u3002<code>customText<\/code><code>colorName<\/code><code>customText<\/code><code>colorName<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6dfb\u52a0\u7ec4\u4ef6\u548c\u7ec4\u4ef6\uff0c\u5e76\u4e3a\u6bcf\u4e2a\u7ec4\u4ef6\u63d0\u4f9b\u6807\u7b7e\u3002<code>customText<\/code><code>colorName<\/code><\/li>\n\n\n\n<li>\u5728\u7ec4\u4ef6\u7684 Name of Color \u5b57\u6bb5\u4e2d\uff0c\u9009\u62e9\u7ec4\u4ef6\u4f5c\u4e3a\u6e90\u3002<code>colorName<\/code><code>customText<\/code><\/li>\n<\/ol>\n\n\n\n<p>\u5bf9\u7ec4\u4ef6\u6240\u505a\u7684\u4efb\u4f55\u66f4\u6539\u90fd\u4f1a\u81ea\u52a8\u53cd\u6620\u5728 \u4e2d\u7684\u989c\u8272\u516c\u5171\u5b57\u6bb5\u4e2d\u3002\u4f8b\u5982\uff0c\u8f93\u5165\u8f93\u5165\u4f1a\u5bfc\u81f4\u663e\u793a\u5177\u6709\u76f8\u540c\u989c\u8272\u6837\u5f0f\u7684\u989c\u8272\u540d\u79f0\uff0c\u5373\u6d0b\u7ea2\u8272\u3002<code>customText<\/code><code>colorName<\/code><code>magenta<\/code><code>customText<\/code><code>colorName<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"best-practices-for-reactivity-in-screen-flows\">\u5c4f\u5e55\u6d41\u4e2d\u53cd\u5e94\u6027\u7684\u6700\u4f73\u505a\u6cd5<\/h2>\n\n\n\n<p>\u786e\u4fdd\u60a8\u7684 Lightning Web \u7ec4\u4ef6\u5728 Flow \u8fd0\u884c\u65f6\u5f15\u64ce\u4e2d\u5f88\u597d\u5730\u96c6\u6210\uff0c\u5e76\u6309\u9884\u671f\u5de5\u4f5c\u4ee5\u5b9e\u73b0 Screen Flow \u53cd\u5e94\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u72b6\u6001\u7ba1\u7406\u548c\u53cd\u5e94\u6027<\/h2>\n\n\n\n<p>\u8fd9\u4e9b\u90e8\u5206\u4ecb\u7ecd\u4e86\u5728\u5c4f\u5e55\u6d41\u4e2d\u5177\u6709\u53cd\u5e94\u6027\u7684\u72b6\u6001\u7ba1\u7406\uff0c\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LWC \u72b6\u6001\u7ba1\u7406\u4e0e Aura \u6709\u4f55\u4e0d\u540c<\/li>\n\n\n\n<li>\u72b6\u6001\u7ba1\u7406\u5728\u65b0\u7684 LWC Flow Runtime \u4e2d\u7684\u5de5\u4f5c\u539f\u7406<\/li>\n\n\n\n<li>\u4e3a\u5c4f\u5e55\u6d41\u6784\u5efa LWC \u65f6\u8981\u9075\u5faa\u7684\u72b6\u6001\u7ba1\u7406\u548c\u4e8b\u4ef6\u6700\u4f73\u5b9e\u8df5<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Aura \u4e0e LWC \u4e2d\u7684\u72b6\u6001\u7ba1\u7406<\/h2>\n\n\n\n<p>Aura \u7ec4\u4ef6\u548c LWC \u7684\u72b6\u6001\u7ba1\u7406\u9075\u5faa\u4e0d\u540c\u7684\u8303\u5f0f\u3002\u5728 Aura \u7ec4\u4ef6\u4e2d\uff0c\u7531\u5b83\u4eec\u6240\u5c5e\u7684\u7ec4\u4ef6\uff08\u5305\u62ec\u5916\u90e8\u7ec4\u4ef6\uff09\u67e5\u770b\u548c\u4fee\u6539\u3002LWC \u88ab\u8bbe\u8ba1\u4e3a\u5728\u5185\u90e8\u548c\u5916\u90e8\u72b6\u6001\u4e4b\u95f4\u5177\u6709\u660e\u786e\u7684\u5206\u79bb\u3002\u58f0\u660e\u7684\u53d8\u91cf\u53ea\u80fd\u7531 LWC \u7684\u7236\u7ea7\u4fee\u6539\u3002\u6ca1\u6709\u6ce8\u91ca\u7684\u53d8\u91cf\u548c\u5e26\u6709\u6ce8\u91ca\u7684\u53d8\u91cf\u88ab\u89c6\u4e3a\u5185\u90e8\u72b6\u6001\uff0c\u53ef\u4ee5\u5728\u5b9a\u4e49\u5b83\u4eec\u7684 LWC \u4e2d\u66f4\u6539\u3002<code>&lt;aura:attributes \/&gt;<\/code><code>@api<\/code><code>@api<\/code><code>@track<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c4f\u5e55\u6d41\u4e2d\u7684 LWC \u72b6\u6001\u7ba1\u7406<\/h2>\n\n\n\n<p>Flow \u8fd0\u884c\u65f6\u9075\u5faa LWC \u72b6\u6001\u7ba1\u7406\u8bbe\u8ba1\u539f\u5219\u3002\u5f53\u5b83\u6e32\u67d3\u7684 LWC \u7ec4\u4ef6\u4e0d\u4fee\u6539\u5176\u81ea\u8eab\u5c5e\u6027\u65f6\uff0c\u5b83\u6548\u679c\u6700\u4f73\u3002\u76f8\u53cd\uff0c\u7ec4\u4ef6\u901a\u8fc7\u89e6\u53d1\u8bf7\u6c42\u66f4\u6539\uff0c\u8fd9\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\uff0c\u539f\u56e0\u6709\u51e0\u4e2a\u3002<code>@api<\/code><code>FlowAttributeChangeEvent<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5141\u8bb8\u5176\u7236\u7ea7\u63a7\u5236\u5176\u5c5e\u6027\u7684\u7ec4\u4ef6\u66f4\u5bb9\u6613\u91cd\u7528\uff0c\u56e0\u4e3a\u5b83\u4eec\u5141\u8bb8\u5e94\u7528\u7a0b\u5e8f\u63a7\u5236\u72b6\u6001\uff0c\u800c\u4e0d\u662f\u7ec4\u4ef6\u81ea\u5df1\u7684\u5185\u90e8\u4e1a\u52a1\u903b\u8f91\u3002<code>@api<\/code><\/li>\n\n\n\n<li>\u901a\u8fc7\u89e6\u53d1\u5c5e\u6027\u66f4\u6539\u4e8b\u4ef6\uff0cFlow \u8fd0\u884c\u65f6\u53ef\u4ee5\u51c6\u786e\u4e86\u89e3\u7ec4\u4ef6\u72b6\u6001\u3002Flow \u8fd0\u884c\u65f6\u53ef\u4ee5\u63a7\u5236\u7ec4\u4ef6\u95f4\u7684\u4ea4\u4e92\uff0c\u4f8b\u5982\u6761\u4ef6\u5b57\u6bb5\u53ef\u89c1\u6027\uff0c\u8fd9\u662f\u53cd\u5e94\u6027\u7684\u4e00\u90e8\u5206\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4f7f\u7528\u00a0LWC linter \u89c4\u5219\u662f\u786e\u4fdd\u7ec4\u4ef6\u4e0d\u4f1a\u4fee\u6539\u5c5e\u6027\u7684\u7edd\u4f73\u65b9\u6cd5\u3002\u5728\u5f00\u53d1\u73af\u5883\u4e2d\u8bbe\u7f6e\u4f7f\u7528 LWC \u7684 linter \u89c4\u5219\u7684 linter\uff0c\u7279\u522b\u662f\u786e\u4fdd\u5f3a\u5236\u6267\u884c\u8be5\u8bbe\u7f6e\u3002<code>@api<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6d41\u5bfc\u822a\u65f6\u7684\u72b6\u6001\u7ba1\u7406<\/h2>\n\n\n\n<p>\u4e3a\u4e86\u5728 Flow Runtime \u7248\u672c\u4e4b\u95f4\u4fdd\u6301\u4e00\u81f4\u7684\u884c\u4e3a\uff0c\u5f53\u7528\u6237\u5355\u51fb\u201c<strong>\u4e0b\u4e00\u6b65<\/strong>\u201d\u6216<strong>\u201c\u5b8c\u6210\u201d<\/strong>\u6309\u94ae\u65f6\uff0cFlow Runtime \u4f1a\u901a\u8fc7\u63d0\u53d6\u6bcf\u4e2a\u81ea\u5b9a\u4e49 LWC \u7ec4\u4ef6\u7684\u5f53\u524d\u5c5e\u6027\u72b6\u6001\u6765\u6536\u96c6\u503c\uff0c\u7136\u540e\u518d\u79fb\u52a8\u5230\u4e0b\u4e00\u4e2a\u5c4f\u5e55\u6216\u5b8c\u6210\u6d41\u7a0b\u3002\u6b64\u673a\u5236\u53ef\u786e\u4fdd\u4e0d\u7b26\u5408\u89c4\u5b9a\u8bbe\u8ba1\u6a21\u5f0f\u7684\u7ec4\u4ef6\u5728\u6700\u65b0\u7684 Flow Runtime \u7248\u672c\u4e2d\u7ee7\u7eed\u5de5\u4f5c\u3002\u5f3a\u70c8\u5efa\u8bae\u907f\u514d\u4f9d\u8d56\u6b64\u884c\u4e3a\u3002<code>@api<\/code><\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6587\u672c\u8f93\u5165\u7ec4\u4ef6\u793a\u4f8b\uff0c\u8be5\u7ec4\u4ef6\u6f14\u793a\u4e86\u89e6\u53d1\u800c\u4e0d\u662f\u66f4\u65b0 LWC \u7684\u5c5e\u6027\uff1a<code>FlowAttributeChangeEvent<\/code><code>@api<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@api textValue;\n\nhandleTextInputChange(event) {\n  const event = new FlowAttributeChangeEvent('textValue', event.target.value);\n  this.dispatchEvent(event);\n}<\/code><\/pre>\n\n\n\n<p>\u4e0d\u5efa\u8bae\u4f7f\u7528\u4ee5\u4e0b\u793a\u4f8b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Don\u2019t do this\n@api textValue;\n\nhandleTextInputChange(event) {\n  this.textValue = event.target.value;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u521b\u5efa FlowAttributeChangeEvent \u5b9e\u4f8b<\/h2>\n\n\n\n<p>\u8be5\u4e8b\u4ef6\u4f7f LWC \u80fd\u591f\u901a\u77e5\u8fd0\u884c\u65f6\u5176\u5f53\u524d\u72b6\u6001\u3002\u5b83\u662f Flow Runtime \u72b6\u6001\u7ba1\u7406\u673a\u5236\u7684\u4e00\u90e8\u5206\u3002\u6bcf\u5f53\u7528\u6237\u4ea4\u4e92\u5bfc\u81f4\u9700\u8981\u66f4\u65b0\u5c5e\u6027\u7684\u4fee\u6539\u65f6\uff0c\u90fd\u4f1a\u89e6\u53d1\u8fd9\u4e9b\u4e8b\u4ef6\u3002<code>FlowAttributeChangeEvent<\/code><code>@api<\/code><\/p>\n\n\n\n<p>\u4ece\u6a21\u5757\u5bfc\u5165\u3002<code>FlowAttributeChangeEvent<\/code><code>lightning\/flowSupport<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { FlowAttributeChangeEvent } from \"lightning\/flowSupport\";<\/code><\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u4e8b\u4ef6\u7684\u5b9e\u4f8b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const attributeChangeEvent = new FlowAttributeChangeEvent(apiParameterName, updatedValue);<\/code><\/pre>\n\n\n\n<p><code>FlowAttributeChangeEvent<\/code>\u5305\u62ec\u4e24\u4e2a\u53c2\u6570\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>apiParameterName<\/code>&#8211; \u8981\u4fee\u6539\u7684 API \u5c5e\u6027\u7684\u540d\u79f0\u3002<\/li>\n\n\n\n<li><code>updatedValue<\/code>&#8211; Flow \u5c5e\u6027\u7684\u66f4\u65b0\u503c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5c06\u5b57\u7b26\u4e32\u4f20\u9012\u7ed9\u4e0e JavaScript \u548c\u6587\u4ef6\u4e2d\u663e\u793a\u7684 API \u5c5e\u6027\u5339\u914d\u7684\u5b57\u7b26\u4e32\u3002<code>apiParameterName<\/code><code>.js-meta.xml<\/code><\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u8bf7\u6ce8\u610f how \u5728\u6240\u6709 3 \u4e2a\u5730\u65b9\u90fd\u662f\u4e00\u81f4\u7684\uff1a<code>exampleApiParameterName<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728 LWC \u7684\u6587\u4ef6\u4e2d\u58f0\u660e\u5c5e\u6027\uff1a<code>.js-meta.xml<\/code><code>&lt;property name=\"exampleApiParameterName\" label=\"Example Api Parameter\" ...\/&gt;<\/code><\/li>\n\n\n\n<li>\u5728 LWC \u7684\u6587\u4ef6\u4e2d\u58f0\u660e API \u5c5e\u6027\uff1a<code>.js<\/code><code>@api exampleApiParameterName;<\/code><\/li>\n\n\n\n<li>\u6784\u9020\u5b9e\u4f8b\uff1a<code>FlowAttributeChangeEvent<\/code><code>const changeEvent = new FlowAttributeChangeEvent(\"exampleApiParameterName\", \"newValue\");<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u4f20\u9012 \u4ee5\u5339\u914d\u6587\u4ef6\u4e2d\u58f0\u660e\u7684\u6570\u636e\u7c7b\u578b\u3002<code>updatedValue<\/code><code>.js-meta.xml<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c06\u5c5e\u6027\u58f0\u660e\u4e3a Record\uff1a<code>const changeEvent = new FlowAttributeChangeEvent(\"exampleApiParameterName\", { StringFieldName: \"stringValue\", BooleanFieldName: false, NumberFieldName: 42, DateTimeFieldName: \"2022-12-15T23:35:24.000Z\", });<\/code><\/li>\n\n\n\n<li>\u5c06\u5c5e\u6027\u58f0\u660e\u4e3a\u5b57\u7b26\u4e32\uff1a<code>const changeEvent = new FlowAttributeChangeEvent(\"exampleApiParameterName\", \"newValue\");<\/code><\/li>\n\n\n\n<li>\u5c06\u5c5e\u6027\u58f0\u660e\u4e3a\u6570\u5b57\uff1a<code>const changeEvent = new FlowAttributeChangeEvent(\"exampleApiParameterName\", 6);<\/code><\/li>\n\n\n\n<li>\u5c06\u5c5e\u6027\u58f0\u660e\u4e3a\u5e03\u5c14\u503c\uff1a<code>const changeEvent = new FlowAttributeChangeEvent(\"exampleApiParameterName\", true);<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e6\u53d1 FlowAttributeChangeEvent \u4e8b\u4ef6<\/h2>\n\n\n\n<p>\u6784\u9020\u5b9e\u4f8b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u8be5\u65b9\u6cd5\u89e6\u53d1\u4e8b\u4ef6\u3002<code>FlowAttributeChangeEvent<\/code><code>this.dispatchEvent(eventToFire)<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const attributeChangeEvent = new FlowAttributeChangeEvent(\"apiPropertyName\", 10);\nthis.dispatchEvent(attributeChangeEvent);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">FlowAttributeChangeEvent \u6700\u4f73\u5b9e\u8df5<\/h2>\n\n\n\n<p>\u8bf7\u9075\u5faa\u8fd9\u4e9b\u793a\u4f8b\u5e76\u907f\u514d\u6709\u95ee\u9898\u7684\u7528\u6cd5\uff0c\u4ee5\u51cf\u5c11\u6d41\u7a0b\u7248\u672c\u5347\u7ea7\u540e\u7684\u610f\u5916\u884c\u4e3a\u3002\u8fd9\u4e9b\u6700\u4f73\u5b9e\u8df5\u4f7f\u60a8\u80fd\u591f\u66f4\u8f7b\u677e\u5730\u7ef4\u62a4\u7ec4\u4ef6\u3002<code>FlowAttributeChangeEvent<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u6216\u5728\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u4e2d\u8c03\u7528\u7684\u65b9\u6cd5\u4e2d\u89e6\u53d1\u4e8b\u4ef6\u3002<\/li>\n\n\n\n<li>\u5c06\u4e8b\u4ef6\u7684 value \u53c2\u6570\u9650\u5236\u4e3a\u4ee5\u4e0b\u6570\u636e\u7c7b\u578b\uff1aString\u3001number\u3001boolean\u3001JSON\uff08\u7528\u4e8e\u8bb0\u5f55\u7c7b\u578b\uff09\u3002<\/li>\n\n\n\n<li>\u786e\u4fdd\u4e8b\u4ef6\u7684 value \u53c2\u6570\u7684 Flow \u6570\u636e\u7c7b\u578b\u4e0e LWC \u5c5e\u6027\u7684\u6570\u636e\u7c7b\u578b\u5339\u914d\u3002<code>@api<\/code><\/li>\n\n\n\n<li>\u5728\u9002\u5f53\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u4f7f\u7528 get\/set \u6a21\u5f0f\u6765\u54cd\u5e94\u5bf9\u5c5e\u6027\u7684\u66f4\u6539\u3002<code>@api<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u6b64\u793a\u4f8b\u6f14\u793a\u5982\u4f55\u4f7f\u7528 getter \u548c setter \u5bf9\u5c5e\u6027\u7684\u66f4\u65b0\u8fdb\u884c\u8ba1\u6570\uff0c\u800c\u4e0d\u662f\u5728\u89e6\u53d1\u5c5e\u6027\u66f4\u6539\u4e8b\u4ef6\u4e4b\u524d\u9012\u589e\u8ba1\u6570\u5668\u3002\u8fd9\u4e24\u79cd\u6a21\u5f0f\u90fd\u662f\u6709\u6548\u7684\uff0c\u4f46\u5b83\u4eec\u83b7\u5f97\u7684\u7ed3\u679c\u7565\u6709\u4e0d\u540c\u3002<code>@api<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@api textValue;\ntextValueToRender;\nchangeCounter = 0;\n\nget textValue() {\n  return this.textValueToRender;\n}\n\n\/\/ Due to the nature of the Flow Runtime, this setter method\n\/\/ is called after the FlowAttributeChangeEvent fired below. It also\n\/\/ is invoked when reactivity leads to a change to the textValue property.\nset textValue(newTextValue) {\n  this.changeCounter++;\n  this.textValueToRender = newTextValue;\n}\n\nhandleTextInputChange(event) {\n  const event = new FlowAttributeChangeEvent('textValue', event.target.value);\n  this.dispatchEvent(event);\n}<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6bcf\u5f53\u7528\u6237\u5728\u6587\u672c\u8f93\u5165\u4e2d\u8f93\u5165\u66f4\u6539\u4ee5\u53ca Flow Runtime \u786e\u5b9a\u5c5e\u6027\u5df2\u66f4\u6539\u65f6\uff0c\u90fd\u4f1a\u9012\u589e\u3002\u8fd9\u79cd\u65b9\u6cd5\u8003\u8651\u4e86\u7ec4\u4ef6\u521d\u59cb\u5316\u548c\u901a\u8fc7\u53cd\u5e94\u6027\u8fdb\u884c\u7684\u8de8\u7ec4\u4ef6\u4ea4\u4e92\u3002\u4f7f\u7528\u4e2d\u95f4\u53d8\u91cf\u5448\u73b0\u6765\u81ea set \u65b9\u6cd5\u7684\u66f4\u65b0\u3002\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u586b\u5145\u6b64\u89d2\u8272\u3002<code>this.changeCounter<\/code><code>textValue<\/code><code>textValueToRender<\/code><\/p>\n\n\n\n<p>\u4e0b\u9762\u7684\u4ee3\u7801\u793a\u4f8b\u5728\u89e6\u53d1\u5c5e\u6027\u66f4\u6539\u4e8b\u4ef6\u4e4b\u524d\u9012\u589e\u8ba1\u6570\u5668\u3002\u6b64\u65b9\u6848\u4e0d\u4f7f\u7528 get\/set \u6a21\u5f0f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@api textValue;\nchangeCounter = 0;\n\nhandleTextInputChange(event) {\n  this.changeCounter++;\n  const event = new FlowAttributeChangeEvent('textValue', event.target.value);\n  this.dispatchEvent(event);\n}<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6bcf\u5f53\u7528\u6237\u5728\u6587\u672c\u8f93\u5165\u4e2d\u8f93\u5165\u66f4\u6539\u65f6\uff0c\u90fd\u4f1a\u9012\u589e\u3002\u5f53\u53cd\u5e94\u6027\u66f4\u6539\u6b64\u5b57\u6bb5\u7684\u503c\u65f6\uff0c\u8ba1\u6570\u5668\u4e0d\u4f1a\u66f4\u65b0\u3002<code>this.changeCounter<\/code><\/p>\n\n\n\n<p>\u4f7f\u7528\u65e0\u6ce8\u91ca\u6216\u5c5e\u6027\u6765\u7ef4\u62a4\u53ef\u4fee\u6539\u7684\u672c\u5730\u7ec4\u4ef6\u72b6\u6001\u3002<code>@track<\/code><\/p>\n\n\n\n<p>\u4e0b\u9762\u7684\u793a\u4f8b\u6f14\u793a\u4e00\u4e2a\u989c\u8272\u9009\u53d6\u5668\uff0c\u8be5\u9009\u53d6\u5668\u5411\u7528\u6237\u663e\u793a\u8f93\u5165\u6587\u672c\u6846\u548c\u4e00\u4e9b\u8272\u677f\u3002\u989c\u8272\u9009\u53d6\u5668\u7ec4\u4ef6\u8fd4\u56de\u5230\u6d41\u4e2d\uff0c\u56e0\u6b64\u53ea\u9700\u8981\u6ce8\u91ca\u3002and \u6210\u5458\u4ec5\u662f\u5185\u90e8\u6210\u5458\uff0c\u4e0d\u9700\u8981\u4efb\u4f55\u88c5\u9970\u5668\u3002<code>color<\/code><code>color<\/code><code>@api<\/code><code>selectedSwatchId<\/code><code>inputValue<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/colorPicker.js\n\n@api color;\n\ninputValue;\nselectedSwatchId;\n\n\nALL_SWATCHES =&#91;{\n  'id': 1,\n  'color': 'red'\n}, {\n  'id': 2,\n  'color': 'blue'\n}, {\n  'id': 3,\n  'color': 'green'\n}, {\n  'id': 4,\n  'color': 'yellow'\n}];\n\nset color(newColor) {\n  \/\/ Set the content of the input text to the color value:\n  this.inputValue = newColor;\n\n  \/\/ If the color matches a swatch, highlight it in the UI:\n  const foundSwatch = this.ALL_SWATCHES.find(swatch =&gt; swatch.color === newColor);\n  this.selectedSwatchId = foundSwatch &amp;&amp; foundSwatch.id;\n}\n\nget color() {\n  return this.inputValue;\n}\n\nhandleSwatchSelected(event) {\n  \/\/ Select get the swatch data for the clicked swatch:\n  const selectedSwatch = this.ALL_SWATCHES.find(swatch =&gt; swatch.id === event.target.dataset.id);\n  const changeEvent = new FlowAttributeChangeEvent('color', selectedSwatch.color);\n  this.dispatchEvent(changeEvent);\n}\n\nhandleInputValueChange(event) {\n  this.inputValue = event.target.value;\n  const changeEvent = new FlowAttributeChangeEvent('color', this.inputValue);\n  this.dispatchEvent(changeEvent);\n}<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528 get \u65b9\u6cd5\u5c06\u591a\u4e2a\u5c5e\u6027\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u4e3a\u89c6\u56fe\u6784\u9020\u6d3e\u751f\u53d8\u91cf\u3002<code>@api<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Salutation.js\n@api firstName;\n@api lastName;\n@api ageName;\n\nget salutation() {\n  return `Hello ${this.firstName} ${this.lastName}, you are ${this.age} years old.`;\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- Salutation.html --&gt;\n&lt;template&gt;\n  &lt;div&gt;{salutation}&lt;\/div&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u5728\u53c2\u4e0e\u5185\u90e8\u7ec4\u4ef6\u72b6\u6001\u7ba1\u7406\u6240\u9700\u7684\u6d3e\u751f\u6210\u5458\u53d8\u91cf\u7684\u6bcf\u4e2a\u5c5e\u6027\u7684 set \u65b9\u6cd5\u4e2d\u5e94\u7528\u76f8\u540c\u7684\u903b\u8f91\uff0c\u5c31\u50cf\u5728\u6bd4\u4e0a\u4e00\u4e2a\u793a\u4f8b\u66f4\u590d\u6742\u7684\u65b9\u6848\u4e2d\u4e00\u6837\u3002\u6b64\u903b\u8f91\u53ef\u786e\u4fdd\u5bf9\u4efb\u4f55\u8d21\u732e\u5c5e\u6027\u6240\u505a\u7684\u66f4\u6539\u90fd\u4f1a\u5bfc\u81f4\u503c\u6b63\u786e\u5448\u73b0\uff0c\u800c\u4e0d\u7ba1\u8bbe\u7f6e\u5c5e\u6027\u7684\u987a\u5e8f\u5982\u4f55\u3002<code>@api<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Dropdown.js\nset optionLabels(newOptionLabels) {\n  this.internalOptionLabels = newOptionLabels;\n  this.options = this.computeOptions();\n}\n\nset optionValues(newOptionValues) {\n  this.internalOptionValues = newOptionValues;\n  this.options = this.computeOptions();\n}\n\nset value(newValue) {\n  this.internalValue = newValue;\n  this.options = this.computeOptions();\n}\n\nhandleSelect(event) {\n  const selectedValue = event.srcElement.value;\n  const isAlreadySelected = this.options.some(option =&gt; {\n    return option.isSelected &amp;&amp; option.value === selectedValue;\n  });\n\n  if (!isAlreadySelected) {\n    const attributeChange = new FlowAttributeChangeEvent('value', selectedValue);\n    this.dispatchEvent(attributeChange);\n  }\n}\n\ncomputeOptions() {\n  if (this.internalOptionLabels.length !== this.internalOptionValues.length) {\n    return &#91;];\n  }\n\n  return this.internalOptionLabels.map((label, index) ==&gt; {\n    const value = this.internalOptionValues&#91;index];\n    const isSelected = this.internalValue === value;\n    return {\n      label,\n      value,\n      isSelected\n    };\n  });\n}<\/code><\/pre>\n\n\n\n<p>\u4e0d\u8981\u4fee\u6539\u5c5e\u6027\u3002\u800c\u662f\u5f00\u706b\u3002<code>@api<\/code><code>FlowAttributeChangeEvents<\/code><\/p>\n\n\n\n<p>\u4e0d\u8981\u5728\u6784\u9020\u540e\u4fee\u6539\u53c2\u6570\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b9e\u4f8b\u662f\u7ec4\u5408\u548c\u5192\u6ce1\u7684\u3002<code>FlowAttributeChangeEvent<\/code><code>FlowAttributeChangeEvent<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const changeEvent = new FlowAttributeChangeEvent(\"prop\", \"value\");\nchangeEvent.bubbles = false; \/\/ Don\u2019t do this\nchangeEvent.composed = false; \/\/ Don\u2019t do this<\/code><\/pre>\n\n\n\n<p>\u907f\u514d\u540c\u65f6\u53d1\u751f\u5c04\u51fb\u548c\u4e8b\u4ef6\uff0c\u56e0\u4e3a\u5b83\u53ef\u80fd\u5bfc\u81f4\u4e89\u7528\u6761\u4ef6\u3002\u6211\u4eec\u6c38\u8fdc\u65e0\u6cd5\u4fdd\u8bc1\u60a8\u7684 Lightning Web \u7ec4\u4ef6\u5728\u5bfc\u822a\u8fc7\u7a0b\u5f00\u59cb\u65f6\u6709\u65f6\u95f4\u5448\u73b0\u66f4\u65b0\u7684\u503c\u3002<code>FlowAttributeChangeEvents<\/code><code>FlowNavigationXxx<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6d3e\u751f\u5c5e\u6027\u6700\u4f73\u5b9e\u8df5<\/h2>\n\n\n\n<p>\u5728\u6d41\u7ec4\u4ef6\u4e2d\uff0c<em>\u6d3e\u751f<\/em>\u5c5e\u6027\u662f\u5176\u503c\u7531\u540c\u4e00\u7ec4\u4ef6\u7684\u5176\u4ed6\u5c5e\u6027\u786e\u5b9a\u7684\u5c5e\u6027\u3002\u8be5\u503c\u53ef\u80fd\u4e0e\u4e00\u4e2a\u6216\u591a\u4e2a\u5176\u4ed6\u5c5e\u6027\u76f8\u5173\u8054\u3002\u4f8b\u5982\uff0c\u6570\u636e\u8868\u7ec4\u4ef6\u7684\u53c2\u6570\u662f\u6d3e\u751f\u5c5e\u6027\uff0c\u56e0\u4e3a\u5b83\u7684\u503c\u7531\u5c5e\u6027\u7684\u503c\u786e\u5b9a\u3002\u5177\u4f53\u800c\u8a00\uff0c\u53c2\u6570\u7684\u503c\u662f\u5c5e\u6027\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u503c\u3002<code>firstSelectedRow<\/code><code>selectedRows<\/code><code>firstSelectedRow<\/code><code>selectedRows<\/code><\/p>\n\n\n\n<p>\u521b\u5efa\u5305\u542b\u6d3e\u751f\u5c5e\u6027\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u65f6\uff0c\u8bf7\u9075\u5faa\u6b64\u5904\u6982\u8ff0\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4ee5\u786e\u4fdd\u7ec4\u4ef6\u5728\u54cd\u5e94\u5f0f\u6846\u67b6\u4e2d\u6b63\u5e38\u8fd0\u884c\u3002\u901a\u8fc7\u8fd9\u4e9b\u6700\u4f73\u505a\u6cd5\uff0c\u60a8\u53ef\u4ee5\u907f\u514d\u4e0e\u4ee5\u4e0b\u65b9\u9762\u76f8\u5173\u7684\u95ee\u9898\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u53cd\u5e94\u6027\u94fe<\/h3>\n\n\n\n<p>\u5f53\u5bf9\u4e00\u4e2a\u7ec4\u4ef6\u7684\u5c5e\u6027\u8fdb\u884c\u66f4\u6539\u5bfc\u81f4\u5bf9\u5176\u4ed6\u7ec4\u4ef6\u7684\u5c5e\u6027\u8fdb\u884c\u7ea7\u8054\u66f4\u6539\u65f6\uff0c\u5c31\u4f1a\u53d1\u751f\u53cd\u5e94\u94fe\u3002\u4f8b\u5982\uff0c\u7528\u6237\u9009\u62e9\u6570\u636e\u8868\u7ec4\u4ef6\u4e2d\u7684\u4e00\u884c\uff0c\u8fd9\u5c06\u66f4\u6539\u7ec4\u4ef6\u7684\u5c5e\u6027\u503c\uff0c\u4ece\u800c\u66f4\u6539 Name \u7ec4\u4ef6\u7684\u5c5e\u6027\u3002\u5bf9 Name \u7ec4\u4ef6\u7684\u66f4\u6539\u4f1a\u66f4\u6539 Text \u7ec4\u4ef6\u7684\u5c5e\u6027\u3002<code>firstSelectedRow<\/code><code>firstName<\/code><code>value<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5728\u91cd\u65b0\u8bbf\u95ee\u7684\u5c4f\u5e55\u4e0a\u4fdd\u7559\u503c<\/h3>\n\n\n\n<p>\u5f53\u7ba1\u7406\u5458\u914d\u7f6e\u5c4f\u5e55\u65f6\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5728\u7528\u6237\u79bb\u5f00\u65f6\u6d41\u662f\u5426\u4fdd\u7559\u7528\u6237\u6307\u5b9a\u7684\u503c\uff0c\u7136\u540e\u4f7f\u7528\u201c\u4e0a\u4e00\u4e2a\u201d\u6216\u201c\u4e0b\u4e00\u4e2a\u201d\u6309\u94ae\u8fd4\u56de\u5230\u5c4f\u5e55\u3002<\/p>\n\n\n\n<p>\u82e5\u8981\u786e\u4fdd\u6d3e\u751f\u5c5e\u6027\u5728\u5177\u6709\u53cd\u5e94\u6027\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u4e2d\u6309\u9884\u671f\u65b9\u5f0f\u8fd0\u884c\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u51c6\u5219\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u52a1\u5fc5<\/strong>\u5728\u9a71\u52a8\u66f4\u6539\u7684\u5c5e\u6027\u7684\u65b9\u6cd5\u4e2d\u4e3a\u6d3e\u751f\u5c5e\u6027\u89e6\u53d1\u4e8b\u4ef6\u3002\u6b64\u5916\uff0c\u5728\u7ec4\u4ef6\u7684\u65b9\u6cd5\u4e2d\u89e6\u53d1\u6d3e\u751f\u5c5e\u6027\u7684\u4e8b\u4ef6\uff0c\u4f8b\u5982\uff1a<code>FlowAttributeChangeEvent<\/code><code>set<\/code><code>FlowAttributeChangeEvent<\/code><code>connectedCallback<\/code><code>\/\/ 'Driving' attribute set method set stringToCount(newStringToCount) { this._stringToCount = newStringToCount; \/\/ Fire an event for 'derived' attribute const lengthChangeEvent = new FlowAttributeChangeEvent('stringLength', this._stringToCount.length); this.dispatchEvent(lengthChangeEvent); } connectedCallback() { \/\/ Fire an event for 'derived' attribute here as well const lengthChangeEvent = new FlowAttributeChangeEvent('stringLength', this.\\_stringToCount.length); this.dispatchEvent(lengthChangeEvent); }<\/code><\/li>\n\n\n\n<li><strong>\u4e0d\u8981<\/strong>\u5728\u65b9\u6cd5\u4e2d\u7701\u7565\u4e8b\u4ef6\u3002 \u60a8\u5fc5\u987b\u5c06\u4e8b\u4ef6\u5305\u542b\u5728\u4e24\u4e2a\u4f4d\u7f6e\u3002\u5f53\u6d41\u6267\u884c\u9a71\u52a8\u66f4\u6539\u7684\u5c5e\u6027\u7684 in \u65b9\u6cd5\u65f6\uff0c\u7ec4\u4ef6\u4e0d\u5728 DOM \u4e2d\uff0c\u4e8b\u4ef6\u57fa\u672c\u4e0a\u65e0\u5904\u53ef\u53bb\u3002\u5728\u65b9\u6cd5\u4e2d\u6dfb\u52a0\u4e8b\u4ef6\u53ef\u786e\u4fdd\u5f53\u6d41\u5c06\u7ec4\u4ef6\u6dfb\u52a0\u5230 DOM \u65f6\uff0c\u6d41\u8fd0\u884c\u65f6\u53ef\u4ee5\u4f7f\u7528\u8be5\u4e8b\u4ef6\u3002<code>FlowAttributeChangeEvent<\/code><code>connectedCallback<\/code><code>FlowAttributeChangeEvent<\/code><code>FlowAttributeChangeEvent<\/code><code>set<\/code><code>connectedCallback<\/code><\/li>\n\n\n\n<li><strong>\u4e0d\u8981<\/strong>\u5728\u65b9\u6cd5\u4e2d\u7701\u7565\u4e8b\u4ef6\u3002 \u89e6\u53d1\u9a71\u52a8\u66f4\u6539\u7684\u5c5e\u6027\u7684 in \u65b9\u6cd5\u53ef\u786e\u4fdd\u5c06\u66f4\u6539\u5e94\u7528\u4e8e\u9a71\u52a8\u66f4\u6539\u7684\u5c5e\u6027\u548c\u6d3e\u751f\u5c5e\u6027\u3002\u56e0\u6b64\uff0c\u5305\u542b\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u7684\u53cd\u5e94\u6027\u94fe\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002<code>FlowAttributeChangeEvent<\/code><code>set<\/code><code>FlowAttributeChangeEvent<\/code><code>set<\/code><\/li>\n\n\n\n<li><strong>\u4e0d\u8981<\/strong>\u901a\u8fc7\u4f7f\u7528\u6765\u5ef6\u8fdf\u89e6\u53d1\u65b9\u6cd5\u5185\u90e8\u6765\u7701\u7565\u8be5\u65b9\u6cd5\u3002 \u5ef6\u8fdf\u53ef\u786e\u4fdd\u5f53\u6d41\u9996\u6b21\u8c03\u7528\u8be5\u65b9\u6cd5\u65f6\uff0c\u7ec4\u4ef6\u4f4d\u4e8e DOM \u4e2d\u3002\u4f46\u662f\uff0c\u5ef6\u8fdf\u8fd8\u610f\u5473\u7740\u7ec4\u4ef6\u5728\u6d41\u521d\u59cb\u5316\u5c4f\u5e55\u540e\u89e6\u53d1\u4e8b\u4ef6\u3002\u56e0\u6b64\uff0c\u6d41\u8fd0\u884c\u65f6\u59cb\u7ec8\u8986\u76d6\u4fdd\u7559\u7684\u503c\uff0c\u5e76\u5426\u51b3\u91cd\u65b0\u8bbf\u95ee\u7684\u503c\u7684\u8bbe\u7f6e\u3002<code>connectedCallback<\/code><code>Promise.resolve().then(...)<\/code><code>FlowAttributeChangeEvent<\/code><code>set<\/code><code>FlowAttributeChangeEvent<\/code><code>set<\/code><code>set stringToCount(newStringToCount) { this._stringToCount = newStringToCount; const lengthChangeEvent = new FlowAttributeChangeEvent('stringLength', this._stringToCount.length); \/\/ This code overwrites preserved values. Don't do this. Promise.resolve().then(() =&gt; { this.dispatchEvent(lengthChangeEvent); }); }<\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u5bfc\u822a\u66f4\u6539\u4e8b\u4ef6\u6700\u4f73\u5b9e\u8df5<\/h2>\n\n\n\n<p>\u9664\u4e86 \u4e4b\u5916\uff0c\u60a8\u7684 Lightning Web \u7ec4\u4ef6\u8fd8\u53ef\u4ee5\u89e6\u53d1\u5bfc\u822a\u4e8b\u4ef6\u4ee5\u5728\u5c4f\u5e55\u4e4b\u95f4\u79fb\u52a8\u3001\u6682\u505c\u6216\u5b8c\u6210\u6d41\u7a0b\u3002\u8981\u4f7f\u7528\u5bfc\u822a\u4e8b\u4ef6\uff0c\u8bf7\u4ece\u4ee5\u4e0b\u4f4d\u7f6e\u5bfc\u5165\u8fd9\u4e9b\u51fd\u6570\uff1a<code>FlowAttributeChangeEvent<\/code><code>lightning\/flowSupport<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>FlowNavigationNextEvent<\/code><\/li>\n\n\n\n<li><code>FlowNavigationBackEvent<\/code><\/li>\n\n\n\n<li><code>FlowNavigationPauseEvent<\/code><\/li>\n\n\n\n<li><code>FlowNavigationFinishEvent<\/code><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e6\u53d1 FlowNavigationEvent<\/h2>\n\n\n\n<p>\u6b64\u4ee3\u7801\u7247\u6bb5\u4ecb\u7ecd\u5982\u4f55\u5bfc\u5165\u548c\u89e6\u53d1\u5bfc\u822a\u4e8b\u4ef6\u3002\u5f53\u8be5\u793a\u4f8b\u4f7f\u7528 \u65f6\uff0c\u76f8\u540c\u7684\u7ed3\u6784\u9002\u7528\u4e8e\u6bcf\u4e2a\u53ef\u7528\u7684\u5bfc\u822a\u76ee\u6807\u3002<code>FlowNavigationNextEvent<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { FlowNavigationNextEvent } from \"lightning\/flowSupport\";\n\nexport default class FlowExample extends LightningElement {\n  handleCustomNavigationButtonClick() {\n    const nextEvent = new FlowNavigationNextEvent();\n    this.dispatchEvent(nextEvent);\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u5bfc\u822a\u4e8b\u4ef6\u5141\u8bb8\u60a8\u7684 Lightning Web \u7ec4\u4ef6\u5305\u542b\u5176\u4ed6\u63a7\u5236\u673a\u5236\u3002\u5bf9\u6700\u7ec8\u7528\u6237\u4ea4\u4e92\u505a\u51fa\u53cd\u5e94\u65f6\u89e6\u53d1\u5bfc\u822a\u4e8b\u4ef6\u3002\u4f7f\u7528\u5bfc\u822a\u4e8b\u4ef6\u65f6\uff0c\u8bf7\u53c2\u9605\u4ee5\u4e0b\u51c6\u5219\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\uff08\u6216\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u8c03\u7528\u7684\u65b9\u6cd5\u4e2d\uff09\u89e6\u53d1\u5bfc\u822a\u4e8b\u4ef6\u3002<\/li>\n\n\n\n<li>\u4e0d\u8981\u5728\u4e8b\u4ef6\u5904\u7406\u7a0b\u5e8f\u4e4b\u5916\u89e6\u53d1\u5bfc\u822a\u4e8b\u4ef6\uff0c\u56e0\u4e3a\u8fd9\u4f1a\u5bfc\u81f4\u7cdf\u7cd5\u7684\u7528\u6237\u4f53\u9a8c\u3002<\/li>\n\n\n\n<li>\u4e0d\u8981\u5728\u751f\u547d\u5468\u671f\u5904\u7406\u7a0b\u5e8f\uff08\u5982 \u548c\uff09\u4e2d\u89e6\u53d1\u5bfc\u822a\u4e8b\u4ef6\u3002<code>renderedCallback<\/code><code>connectedCallback<\/code><\/li>\n\n\n\n<li>\u5c06\u8df3\u8fc7\u5c4f\u5e55\u7684\u903b\u8f91\u653e\u5728 Flow Decision Nodes \u4e2d\uff0c\u800c\u4e0d\u662f\u653e\u5728\u5c4f\u5e55\u7684\u751f\u547d\u5468\u671f\u4e2d\u3002<\/li>\n\n\n\n<li>\u4e0d\u8981\u5728\u865a\u62df\u5c4f\u5e55\u4e2d\u6267\u884c\u5bfc\u822a\uff0c\u56e0\u4e3a\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4 Flow \u6027\u80fd\u4e0d\u4f73\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u60a8\u9047\u5230\u4ee5\u4e0b\u60c5\u51b5\uff1a\u7531\u4e8e\u6570\u636e\u5c1a\u4e0d\u53ef\u7528\u4e8e Flow Decision Nodes\uff0c\u56e0\u6b64\u5fc5\u987b\u5728\u5c4f\u5e55\u7684\u521d\u59cb\u5316\u9636\u6bb5\u5b8c\u6210\u5bfc\u822a\uff0c\u8bf7\u5728\u00a0Idea Exchange\u00a0\u4e2d\u53d1\u5e03\u5347\u7ea7\u8bf7\u6c42<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002<\/p>\n","protected":false},"author":1,"featured_media":3910,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[233],"tags":[257],"class_list":["post-3909","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lightning-web-","tag-flow-builder"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Flow\u00a0 - \u767d\u767d\u968f\u7b14<\/title>\n<meta name=\"description\" content=\"\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.ponybai.com\/?p=3909\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Flow\u00a0 - \u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"og:description\" content=\"\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.ponybai.com\/?p=3909\" \/>\n<meta property=\"og:site_name\" content=\"\u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-22T13:37:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-02T13:37:49+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/flow.png\" \/>\n\t<meta property=\"og:image:width\" content=\"876\" \/>\n\t<meta property=\"og:image:height\" content=\"480\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ponybai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"ponybai\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3909#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3909\"},\"author\":{\"name\":\"ponybai\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"headline\":\"Flow\u00a0\",\"datePublished\":\"2024-01-22T13:37:09+00:00\",\"dateModified\":\"2023-12-02T13:37:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3909\"},\"wordCount\":293,\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"keywords\":[\"Flow Builder\"],\"articleSection\":[\"Lightning Web \u7ec4\u4ef6\u5f00\u53d1\u4eba\u5458\u6307\u5357\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3909\",\"url\":\"http:\/\/www.ponybai.com\/?p=3909\",\"name\":\"Flow\u00a0 - \u767d\u767d\u968f\u7b14\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/#website\"},\"datePublished\":\"2024-01-22T13:37:09+00:00\",\"dateModified\":\"2023-12-02T13:37:49+00:00\",\"description\":\"\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002\",\"breadcrumb\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3909#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.ponybai.com\/?p=3909\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3909#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.ponybai.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Flow\u00a0\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ponybai.com\/#website\",\"url\":\"http:\/\/www.ponybai.com\/\",\"name\":\"\u767d\u767d\u968f\u7b14\",\"description\":\"Salesforce\u5b98\u65b9\u8bb2\u5e08\",\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ponybai.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\",\"name\":\"ponybai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"contentUrl\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"width\":248,\"height\":248,\"caption\":\"ponybai\"},\"logo\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/121.37.188.161\"],\"url\":\"http:\/\/www.ponybai.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flow\u00a0 - \u767d\u767d\u968f\u7b14","description":"\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.ponybai.com\/?p=3909","og_locale":"zh_CN","og_type":"article","og_title":"Flow\u00a0 - \u767d\u767d\u968f\u7b14","og_description":"\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002","og_url":"http:\/\/www.ponybai.com\/?p=3909","og_site_name":"\u767d\u767d\u968f\u7b14","article_published_time":"2024-01-22T13:37:09+00:00","article_modified_time":"2023-12-02T13:37:49+00:00","og_image":[{"width":876,"height":480,"url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/flow.png","type":"image\/png"}],"author":"ponybai","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"ponybai","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.ponybai.com\/?p=3909#article","isPartOf":{"@id":"http:\/\/www.ponybai.com\/?p=3909"},"author":{"name":"ponybai","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"headline":"Flow\u00a0","datePublished":"2024-01-22T13:37:09+00:00","dateModified":"2023-12-02T13:37:49+00:00","mainEntityOfPage":{"@id":"http:\/\/www.ponybai.com\/?p=3909"},"wordCount":293,"publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"keywords":["Flow Builder"],"articleSection":["Lightning Web \u7ec4\u4ef6\u5f00\u53d1\u4eba\u5458\u6307\u5357"],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/www.ponybai.com\/?p=3909","url":"http:\/\/www.ponybai.com\/?p=3909","name":"Flow\u00a0 - \u767d\u767d\u968f\u7b14","isPartOf":{"@id":"http:\/\/www.ponybai.com\/#website"},"datePublished":"2024-01-22T13:37:09+00:00","dateModified":"2023-12-02T13:37:49+00:00","description":"\u6d41Flow Builder \u5141\u8bb8\u7ba1\u7406\u5458\u4f7f\u7528\u6d41\u81ea\u52a8\u6267\u884c\u4e1a\u52a1\u6d41\u7a0b\u3002\u4e86\u89e3\u5982\u4f55\u5f00\u53d1\u548c\u914d\u7f6e Lightning Web \u7ec4\u4ef6\uff0c\u4ee5\u7528\u4f5c Flow Builder \u4e2d\u64cd\u4f5c\u548c\u5c4f\u5e55\u7ec4\u4ef6\u7684\u6d41\u5c4f\u5e55\u7ec4\u4ef6\u548c\u81ea\u5b9a\u4e49 UI\u3002","breadcrumb":{"@id":"http:\/\/www.ponybai.com\/?p=3909#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.ponybai.com\/?p=3909"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.ponybai.com\/?p=3909#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.ponybai.com\/"},{"@type":"ListItem","position":2,"name":"Flow\u00a0"}]},{"@type":"WebSite","@id":"http:\/\/www.ponybai.com\/#website","url":"http:\/\/www.ponybai.com\/","name":"\u767d\u767d\u968f\u7b14","description":"Salesforce\u5b98\u65b9\u8bb2\u5e08","publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ponybai.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883","name":"ponybai","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/","url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","contentUrl":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","width":248,"height":248,"caption":"ponybai"},"logo":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/121.37.188.161"],"url":"http:\/\/www.ponybai.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3909"}],"version-history":[{"count":2,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3909\/revisions"}],"predecessor-version":[{"id":3912,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3909\/revisions\/3912"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/media\/3910"}],"wp:attachment":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3909"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}