Giter Site home page Giter Site logo

抽屉式交互 about ub-ria HOT 9 CLOSED

otakustay avatar otakustay commented on May 27, 2024
抽屉式交互

from ub-ria.

Comments (9)

wurongyao avatar wurongyao commented on May 27, 2024
  1. 你说的丑陋的开关方案是这个开关放在哪?在新建按钮上价格‘data-target’?
  2. 为什么不删也不是?

from ub-ria.

otakustay avatar otakustay commented on May 27, 2024
  1. 放在FormAction.prototype上……使全系统共享,我似乎没见到有“一些模块用抽屉,一些模块不用”的需求
  2. 不删放着没用多丑,我洁癖……

from ub-ria.

wurongyao avatar wurongyao commented on May 27, 2024

放在FormAction上?FormAction不是被新打开编辑用的那个Action吗?
由它自己控制的展现形式?还是应该由打开它的地方控制?
当然,如果全局统一,随便放在某个配置的地方都行。

from ub-ria.

otakustay avatar otakustay commented on May 27, 2024

哦放在ListAction上……我说错了

from ub-ria.

otakustay avatar otakustay commented on May 27, 2024

代码就类似于这样

this.view.on(
    'create',
    function () {
        if (this.createInLayer) {
            this.openActionLayer(url);
        }
        else {
            this.redirect(url);
        }
    },
    this
);

其实最合适的还是把这个抽屉层抽象为一种“组件”,在任何跳转的地方配一下就可以变成这种交互模式……不过这个设计我暂时没想明白

from ub-ria.

otakustay avatar otakustay commented on May 27, 2024

另外还有在抽屉层里新建完成之后,列表要不要刷新等一系列问题要确定……

from ub-ria.

wurongyao avatar wurongyao commented on May 27, 2024

把 openActionLayer 和 redirect 都抽象成 openAction方法,
通过组件,组件直接覆盖action的默认openAction 方法,而不在openAction方法里加 if 判断。
你所说的列表要不要刷新等一些列问题,则可能需要组件覆盖action更多的属性和方法来做。

我不清楚现在er的action是否支持组件模式,还是单纯的继承模式。

from ub-ria.

otakustay avatar otakustay commented on May 27, 2024

嗯,当然最简单的是抽成ListAction.prototype.openFormPage这样的方法,但这个方法依旧需要一个默认的实现,倾向于实现一套复杂的,要简单的跳转就直接覆盖?

这个openAction感觉面有些大,各个地方出子Action的逻辑不会一样,统一到这上面恐怕有点难

from ub-ria.

wurongyao avatar wurongyao commented on May 27, 2024

默认实现什么都行啊,你的地盘你做主

from ub-ria.

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.