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

默认的className能否通过配置干掉 #10

Closed
lianqin7 opened this issue Dec 21, 2012 · 4 comments
Closed

默认的className能否通过配置干掉 #10

lianqin7 opened this issue Dec 21, 2012 · 4 comments

Comments

@lianqin7
Copy link
Member

如题,通过Switchable组件生成的代码总是会加上ui-switchable-的class,看着难受:(

可否通过配置项的形式干掉,比如navClass之类的

@afc163
Copy link
Member

afc163 commented Dec 21, 2012

建议 @leoner 使用 data-role 的方式进行作用标记,用 className 进行样式标记。提供prefix参数。

@popomore
Copy link
Member

className 是 widget 提供的,只是起到补充样式,如果要替换前缀可以加个 prefixClass,建议康辉可以实现。

看 autocomplete

@leoner
Copy link
Member

leoner commented Dec 21, 2012

好的。

@leoner leoner closed this as completed in eaf3d8f Dec 23, 2012
@lianqin7
Copy link
Member Author

@leoner 可能我描述的不清楚:(,

我的需求是后面的那些 -nav-contentclass是完全可配的 ,不要在代码里强制的addClass,而是通过template或者element指定,这样才能真正的做到 功能与样式分离

    module.exports = function(classPrefix){
        return {
            UI_SWITCHABLE: classPrefix,
            NAV_CLASS: classPrefix + '-nav',
            CONTENT_CLASS: classPrefix + '-content',
            TRIGGER_CLASS: classPrefix + '-trigger',
            PANEL_CLASS: classPrefix + '-panel',
            ACTIVE_CLASS: classPrefix + '-active',
            PREV_BTN_CLASS: classPrefix + '-prev-btn',
            NEXT_BTN_CLASS: classPrefix + '-next-btn',
            DISABLED_BTN_CLASS: classPrefix + '-disabled-btn'
       }
    };

@lianqin7 lianqin7 reopened this Dec 31, 2012
@lianqin7 lianqin7 mentioned this issue Jan 23, 2013
@leoner leoner closed this as completed in c5a69c6 Mar 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants