Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widget 1.1.0 版本 #37

Closed
15 tasks done
popomore opened this issue Apr 2, 2013 · 4 comments
Closed
15 tasks done

widget 1.1.0 版本 #37

popomore opened this issue Apr 2, 2013 · 4 comments
Labels
Milestone

Comments

@popomore
Copy link
Member

popomore commented Apr 2, 2013

整理过去的一些 issue 和新提的 feature,准备升级一个版本。

升级注意

新增点

  1. data-widget-role

  2. delegateEvents 支持其他 DOM 的事件绑定

    this.delegateEvents(this.trigger, 'click p', function() {})
    
  3. 样式方案

    在 this.element 外部会包一层容器,保证样式独立。className 为 family-name-version,css 在编译的时候也会加一层命名空间,如

    .family-name-version .ui-dialog {}
    
  4. set 增加 override

    如果是简单对象,默认是用 merge 的方式,override 可以覆盖当前对象

    Widget.extend({
        attrs: {
            a: {b:1, c:2}
        }
    });
    this.set('a', {b:2}); // => {b:2, c:2}
    this.set('a', {}, {override: true}); // => {}
    
  5. before 能阻止原方法

    this.before('show', function() {
        return false; // 阻止了 show 方法的调用
    });
    

修改点

  1. 不再使用 this.model 和 this.template,使用的时候需要当作 attribute,如 this.get('model')。

  2. templatable 从 widget 中移除,单独为一个组件,修改的时候需要修改 template 的依赖

    "templatable": "arale/templatable/0.9.0/templatable"
    
  3. 注意 attribute 的默认值,当为 '' [] {} 是还是会触发 _onRender

  4. widget 的属性 style id className 默认值改为 null

具体修改点

widget

milestone 1.1.0

base

milestone 1.1.0

events

@lianqin7
Copy link
Member

lianqin7 commented Apr 3, 2013

还是不考虑 plugin 么 :(

@popomore
Copy link
Member Author

popomore commented Apr 3, 2013

plugin 还没讨论清楚,先不在这个版本里做了

@popomore
Copy link
Member Author

补充升级注意

@popomore
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants