一 Programming Model
开发lightning component 有两种模式:
1 the original model—Aura Components
2 the new model—Lightning Web Components.
To belabor the point, in the Lightning Web Components programming model, you create Lightning web components. In the Aura Components programming model, you create Aura components.
在Lightning Web Components编程模型中,您创建了Lightning Web组件。在Aura组件编程模型中,创建Aura组件。
二 Lightning Web Components是什么
Lightning Web Components is an implementation of the W3C’s Web Components standards.
It supports the parts of Web Components that perform well in browsers, and adds only what’s needed to work in all browsers supported by Salesforce.
三 Lightning Web Components的优点
Modern JavaScript
Developer Productivity and Satisfaction :
1 学习创建lwc 比较快
2 使用Lightning web组件编写更少的代码,代码更容易阅读、维护和单元测试。
Code Performance
四 Components Living and Working Together
Aura components can contain Lightning web components.
Lightning web components can’t contain Aura components.
五 Migration Strategy
Migrating code is rarely a straight path. The programming model for Lightning Web Components is fundamentally different than the model for Aura Components. Migrating an Aura component to a Lightning web component is not a line-by-line conversion, and it’s a good opportunity to revisit your component’s design. Before you migrate an Aura component, evaluate the component’s attributes, interfaces, structures, patterns, and data flow.
网友评论