Git Product home page Git Product logo

Comments (7)

errorrik avatar errorrik commented on June 24, 2024

我觉得需要确保。看起来用户貌似没有显式修改的需求,但是可能会这样

var myButton = new Button();
xxCtrl.addChild( myButton );

如果xxCtrl不是在默认viewContext下,myButton的viewContext是需要被更改的。

from esui.

otakustay avatar otakustay commented on June 24, 2024

那么我建议把data-ctrl-iddata-ctrl-view-context的配置丢到Control上去实现,而不在main中搞这事,只要是控件,其主元素就一定有这2个东西

from esui.

otakustay avatar otakustay commented on June 24, 2024

补充一下,如果放在Control上实现,我们需要考虑是否允许setProperties({ viewContext: xxx })这样的写法,如果允许的话,我们还得把viewContext的修改放在repaint上实现,当然实现就一两行代码,不过所有的控件要记得调Control.prototype.repaint

from esui.

errorrik avatar errorrik commented on June 24, 2024

那么我建议把data-ctrl-id和data-ctrl-view-context的配置丢到Control上去实现,而不在main中搞这事,只要是控件,其主元素就一定有这2个东西

配置放main上是为了统一配置项的存放地,万一esui默认使用的data-xxxxxxx与用户已经用了的有冲突,可以在一个地方统一配置

from esui.

errorrik avatar errorrik commented on June 24, 2024

我们需要考虑是否允许setProperties({ viewContext: xxx })这样的写法

我没想到什么场景需要这样用,但是,从一致性上来讲,貌似需要支持

from esui.

otakustay avatar otakustay commented on June 24, 2024

那么我去开工啦- -

from esui.

otakustay avatar otakustay commented on June 24, 2024

53637ca 中支持, @errorrik 做下review没问题关吧?

from esui.

Related Issues (20)

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.