Giter Site home page Giter Site logo

一些疑问 about xuui HOT 3 OPEN

chexiongsheng avatar chexiongsheng commented on August 28, 2024
一些疑问

from xuui.

Comments (3)

chexiongsheng avatar chexiongsheng commented on August 28, 2024

1、目前一个属性一个Adapter,我在实例里头同时监听下拉框的value和options时就有体会到这烦恼,类的个数,以及如何命名的问题,我在想是否能提供一种新的绑定方式:绑定路径指定到一个table,然后相应字段就至少能单向同步到c#同名属性。如果双向同步,就比较难办了,需要提供注册和去注册能力,没地方存不好办。

2、思路1的Adapter就是MonoBehaviour的设计从开销看比较重,不过胜在清晰:节点上直接挂绑定信息。而思路2则轻量级些,个人觉得不如思路1清晰(也有人反馈即使不考虑开销,也喜欢这种方式)。不过两个思路记录的信息是一样的,其实可以通过提供工具转换(配置时按思路1,可转换成思路2供运行时用),而且即使是RawAdapter,最好也是按你说的一些建议来优化表现;

3、我原设想的建议组织方式是Context(VM+Commads)全局一个,而Context只划分一级module,像切换主UI,弹窗和关闭弹窗,都可以看作是一个个View的Attach和Detach,所有View用全路径绑定到各modules。
你说的“module之间可以嵌套”具体是?module下还有子module么?这个貌似没能很好的解决你举的例子吧?
多模块间重用视图的需求是存在的但之前没考虑得很好的,这么处理你觉得怎样?
a、无交互逻辑,这核心冲突是这个重用模块只能设置一个绑定路径,是不是可以通过绑定“相对路径”的方式来解决,在Attach(也有lua对应的接口)时可以传递一个根路径,或者根路径所指向的table来解决;
b、有交互逻辑,则需要新建一个Context来实现,开放接口来供外部调用;

from xuui.

doukouDAI avatar doukouDAI commented on August 28, 2024

看了下代码,不是很明白computed_bind是怎么回事,不知道是否可以解释下,谢谢!

from xuui.

UpUpLiu avatar UpUpLiu commented on August 28, 2024

a、无交互逻辑,这核心冲突是这个重用模块只能设置一个绑定路径,是不是可以通过绑定“相对路径”的方式来解决,在Attach(也有lua对应的接口)时可以传递一个根路径,或者根路径所指向的table来解决;

我觉得这个是可行, 可用于解决各种小的 比如scrollview这种界面的绑定

from xuui.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.