/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/packages/runtime-core/src/__test__/ |
H A D | index.test.js | 15 import ViewModel from '..'; 27 const as2 = new ViewModel({ 36 const vm = new ViewModel({ 55 const vm = new ViewModel({ 79 const vm = new ViewModel({ 102 const vm = new ViewModel({ 124 const vm = new ViewModel({ 142 const vm = new ViewModel({ 160 const vm = new ViewModel({ 178 const vm = new ViewModel({ [all …]
|
/ohos5.0/docs/zh-cn/application-dev/quick-start/ |
H A D | arkts-mvvm.md | 16 - ViewModel:负责管理UI状态和交互逻辑。作为连接Model和View的桥梁,ViewModel监控Model数据的变化,通知View更新UI,同时处理用户交互事件并转换为数据操作。 34 **ViewModel层** 38 > ViewModel层数据和Model层数据的区别: 42 > ViewModel层数据,是提供某个页面上使用的数据,它可能是整个APP的业务数据的一部分。另外ViewModel层还可以附加对应Page的辅助页面显示数据,这部分数据可能与本APP的业务完全无… 61 * Model层数据,不可以直接操作UI,Model层只能通知ViewModel层数据有更新,由ViewModel层更新对应的数据。 553 * LoginViewMode ----- 登录页ViewModel 554 * xxxModel ------ 其他页ViewModel 562 **ViewModel层** 568 * ViewModel层是为视图服务的数据层。它的设计一般来说,有两个特点: 582 > 业务组件包含了ViewModel层数据,没有ViewModel,这个组件不能运行。 [all …]
|
H A D | arkts-mvvm-V2.md | 5 …往决定了应用程序的性能和用户体验。为了解决数据与UI同步的复杂性,ArkUI采用了Model-View-ViewModel(MVVM)架构模式。MVVM将应用分为Model、View和ViewMo… 8 - View:负责用户界面展示数据并与用户交互,不包含任何业务逻辑。它通过绑定ViewModel层提供的数据来动态更新UI。 9 - ViewModel:负责管理UI状态和交互逻辑。作为连接Model和View的桥梁,ViewModel监控Model数据的变化,通知View更新UI,同时处理用户交互事件并转换为数据操作。 12 ## 通过状态管理V2版本实现ViewModel 14 在MVVM模式中,ViewModel扮演着至关重要的角色,负责管理数据状态,并在数据发生变化时自动更新视图。ArkUI的状态管理V2版本提供了丰富的装饰器和工具,帮助开发者在自定义组件之间共享数据,… 869 …应用功能的复杂化,代码的结构变得难以维护,Model、View和ViewModel的职责并没有完全分离,仍然存在一定的耦合。为了更好地组织代码和提升可维护性,使用MVVM模式重构代码,进一步将数据… 940 ### ViewModel层 942 ViewModel层负责管理UI状态和业务逻辑,扮演Model和View之间的桥梁角色。在ViewModel中,负责监控Model数据的变化,处理应用的逻辑,并将数据同步到View层,从而实现UI的… 1010 View层负责应用程序的UI展示和与用户的交互。它只关注如何渲染用户界面和展示数据,不包含业务逻辑。所有的数据状态和逻辑都来自ViewModel层,View层通过接收ViewModel传递的状态数据… 1141 …tleView、ListView、BottomView),用于统一展示待办事项的各个部分,管理任务列表和用户设置。TodoListPage负责从ViewModel中获取数据,并将数据传递给各个子V… [all …]
|
H A D | arkts-new-makeObserved.md | 157 …为了处理应用场景中的并发任务。将makeObserved和@Sendable配合使用是为了满足一般应用开发中,在子线程做大数据处理,在UI线程做ViewModel的显示和观察数据的需求。@Send…
|
H A D | properly-use-state-management-to-develope.md | 597 …上的多个属性可以被拆分进同一个新类,即示例中的NeedRenderImage。适用于组件经常被不关联的属性改变而引起刷新的场景,这个时候就要考虑拆分属性,或者重新考虑ViewModel设计是否合理。
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/packages/runtime-core/src/core/ |
H A D | index.js | 34 export function ViewModel(options) { function 36 if (!(this instanceof ViewModel)) { 37 return new ViewModel(options); 62 ViewModel.prototype.$watch = function(getter, callback, meta) { class
|
/ohos5.0/docs/zh-cn/application-dev/ui/ |
H A D | js-framework-syntax-js.md | 118 | $root | 无 | 获得顶级ViewModel实例。[获取ViewModel](#获取viewmodel)示例。 | 119 | $parent | 无 | 获得父级ViewModel实例。[获取ViewModel](#获取viewmodel)示例。 | 120 …tring | 获得指定id的子级自定义组件的ViewModel实例。[获取ViewModel](#获取viewmodel)示例。<br/>用法:<br/>this.\$child('xxx')&… 218 ## 获取ViewModel
|
H A D | ui-js-overview.md | 22 前端框架层主要完成前端页面解析,并提供MVVM(Model-View-ViewModel)开发模式、页面路由机制和自定义组件等能力。
|
/ohos5.0/docs/en/application-dev/quick-start/ |
H A D | arkts-mvvm.md | 16 - ViewModel: manages UI state and interaction logic. As a bridge between Model and View, ViewModel … 34 **ViewModel** 38 > The differences between the ViewModel data and the Model data are as follows: 42 > ViewModel data provides data used on a page. It may be a part of the service data of the entire a… 60 * View cannot directly call data from Model. Instead, use the methods provided by ViewModel to call. 61 * Model data cannot modify the UI directly but notifies the ViewModel to update the data. 562 **ViewModel** 568 * The ViewModel layer is the data layer that serves views. Generally, it has two features: 582 > A business component contains ViewModel data. Without ViewModel, the component cannot be executed. 598 * ViewModel [all …]
|
H A D | arkts-mvvm-V2.md | 5 …uses the Model-View-ViewModel (MVVM) architecture. The MVVM divides an application into three core… 8 …ce logic is contained. It dynamically updates the UI by binding the data provided by the ViewModel. 9 - ViewModel: manages UI state and interaction logic. As a bridge between Model and View, ViewModel … 12 ## Implementing ViewModel Through V2 14 In the MVVM mode, the ViewModel plays an important role in managing data state and automatically up… 869 …ViewModel are not completely separated, and there is still some coupling. To better organize code … 940 ### ViewModel subsection 942 The ViewModel layer manages the UI state and service logic, and functions as a bridge between Model… 1010 …gic. All data state and logic come from the ViewModel layer. View receives the state data passed b… 1141 …fied manner and manage the task list and settings. It obtains data from ViewModel, passes the data… [all …]
|
H A D | arkts-new-makeObserved.md | 157 …to meet the requirements of big data processing in the sub-thread and **ViewModel** display and da…
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/packages/runtime-core/src/ |
H A D | index.js | 15 import { ViewModel } from './core'; 17 export default ViewModel;
|
/ohos5.0/foundation/arkui/ace_engine/frameworks/core/interfaces/native/node/ |
H A D | node_api.cpp | 244 ViewModel::DisposeNode(node); in DisposeNode() 249 return ViewModel::GetName(node); in GetName() 265 ViewModel::AddChild(parent, child); in AddChild() 275 ViewModel::InsertChildAt(parent, child, position); in InsertChildAt() 281 ViewModel::RemoveChild(parent, child); in RemoveChild() 296 return ViewModel::IsBuilderNode(node); in IsBuilderNode() 1263 ViewModel::SetCallbackMethod(method); in SetCallbackMethod() 1268 return ViewModel::GetCallbackMethod(); in GetArkUIAPICallbackMethod() 1318 return ViewModel::GetAttachNodePtr(node); in GetAttachNodePtr() 1341 auto companion = ViewModel::GetCompanion(node); in RegisterCustomNodeAsyncEvent() [all …]
|
H A D | tab_content_modifier.cpp | 33 auto dispatch = ViewModel::GetCallbackMethod(); in SetTabContentBuilder()
|
H A D | view_model.h | 24 namespace OHOS::Ace::NG::ViewModel {
|
H A D | view_model.cpp | 86 namespace OHOS::Ace::NG::ViewModel { namespace
|
/ohos5.0/docs/en/application-dev/ui/ |
H A D | js-framework-syntax-js.md | 123 …oot | N/A | Obtains the root ViewModel instance. For example code, see [Obtaining th… 124 …ent | N/A | Obtains the parent ViewModel instance. For example code, see [Obtaining th… 125 …ViewModel instance of a custom child component with a specified ID. For example code, see [Obtaini… 226 ## Obtaining the ViewModel
|
H A D | ui-js-overview.md | 22 …Parses UI pages and provides the Model-View-ViewModel (MVVM), page routing, custom components and …
|
/ohos5.0/docs/zh-cn/third-party-cases/ |
H A D | pixel-format-transfer.md | 470 * 像素介绍ViewModel:entry/src/main/ets/viewmodel/IntroducitonViewModel.ets。 645 * 像素转换ViewModel:entry/src/main/ets/viewmodel/ConversionViewModel.ets。
|
/ohos5.0/foundation/arkui/ace_engine/ |
H A D | README.md | 29 …Parses UI pages and provides the Model-View-ViewModel \(MVVM\), page routing, custom components an…
|
/ohos5.0/docs/zh-cn/application-dev/performance/ |
H A D | precisely-control-render-scope.md | 633 …上的多个属性可以被拆分进同一个新类,即示例中的NeedRenderImage。适用于组件经常被不关联的属性改变而引起刷新的场景,这个时候就要考虑拆分属性,或者重新考虑ViewModel设计是否合理。
|
/ohos5.0/base/web/webview/ohos_nweb/prebuilts/ |
H A D | NOTICE | 2355 third_party_software_for_chromium: Android Lifecycle ViewModel
|