[ https://issues.apache.org/jira/browse/WEEX-54?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hanks Zhang resolved WEEX-54. ----------------------------- Resolution: Resolved > [proposal] Support to detect the feature compatibility of weex > -------------------------------------------------------------- > > Key: WEEX-54 > URL: https://issues.apache.org/jira/browse/WEEX-54 > Project: Weex > Issue Type: New Feature > Components: JSFM > Affects Versions: 0.15 > Reporter: Hanks Zhang > Assignee: Hanks Zhang > Priority: Minor > Labels: features > > h2. Background > Because Weex support to extend components and modules, so the host > environment will be very different. Weex needs a mechanism to detect whether > a feature is supported in the current environment. > h2. API Design > {code:javascript} > weex.supports(condition : String) : Boolean | Null > {code} > * param: a formatted string. @TYPE/NAME > * return value: supported -> true | unsupported -> false | unclear -> null > h2. Usage > {code:javascript} > // Detects whether the embed component is supported > weex.supports('@component/embed') > // Detects whether the picker module is supported > weex.supports('@module/picker') > // Detects whether the dom.getComponentRect method is supported > weex.supports('@module/dom.getComponentRect') > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)