红联Linux门户
Linux帮助

Semantic UI 2.0.0发布,前端界面开发框架

发布时间:2015-07-01 16:47:11来源:红联作者:empast
作者的话

这件事情终于搞定了。这个更新日志大概有10页纸那么长,所以我事先说声抱歉。我尝试将重要的变动都放在更新日志的最上面,来帮助大家更快的了解。

谢谢每一位朋友。

Semantic UI 2.0.0 发布,更新内容如下:

迁移指导

迁移不会太困难,只要注意以下这些重要改进:

Modal -如果你的 modal 有图片内容,那么你需要在父元素使用图片内容。因为 flex 规则要求父样式,previoustable-row 规则不要求。

Modal - Modal 现在只能在匹配禁用和启用选择器的按钮中关闭。任意按钮都要在匹配其中一个选择器的点击下才能隐藏 modal,或者 call$('.ui.modal').modal('hide') onclick。

网格 - 废弃页面网格,因为页面网格样式响应页面内容

下拉- 下拉功能现在会根据现有的可用屏幕空间来改变打开方向,可以强制打开方向({ direction: 'upward'})

表单验证 - 表单验证现在通过一个字段对象传递设置。

复选框 - 复选框 fireOnInit 现在默认是 false。

下拉功能 - 下拉项描述在默认主题中是浮动的,而且应该被包含在其他项内容的前面

表单 - 内联分组字段不再水平显示

输入 - 在图标输入中,除非是链接图标,已经移除了 pointer-events

弹出 - 弹出不再默认是唯一的。弹出一个的时候不需要再关闭其他可见的弹出


颜色 - 默认颜色调整,只会轻微的改变你的设计


Segment - Segment 不再默认包含 clearfix



Rail - Rail 现在使用 border-box 来代替 content-box


菜单 - 移除了分层菜单



Tab - onTabInit 和 onTabLoad 重命名为 onFirstLoad 和 onLoadrespectively


Button - 宽度变更使用 numbers 2 wide,移除了 3 wide,因为不兼容一些构建工具。请使用 two wide 或者 three wide 代替



Video - 未公开的视频模块重命名为 embed,行为是一样的,但是用户需要调整他们的 JavaScript 初始化为 $('.ui.embed').embed();



API - 当请求错误(504, 404 etc), aborted (page change or CORS) 或者 JSON 没有通过 successTestfunction 的时候,API onFailure 被称之为 in all failure conditions



新 UI 元素


Container - Containers are fixed width containers meant for holding page contents, and are a simpler alternative to ui page grid, view more examples in docs


Multiselect - New multiple dropdown types have been added. Many new dropdown improvements have been added including tagging/tokenizing features and loading data through API requests.


Embed - New embed component allows for responsive iframe embeds that maintain their aspect ratio. Embed can be used with YouTube or Vimeo videos, along with placeholder content to avoid loading third party libraries until a user chooses to interact with the video.


主要改进(务必要看!)

Site - 添加新的颜色:橄榄,紫色,棕色和灰色 Thanks @lemartialou


API - API can now be used with mocked responses, and custom AJAX requests.mockResponse has been added to resolve request with a prespecified JSON object, or a synchronous function callback.


API mockResponseAsync has been added for custom asynchronous requests. This allows you to specify a custom async callback to resolve an API request, helping with integration with libraries like Ember or Angular that may wrap AJAX requests.


API - API callbacks now have an onResponse callback that can adjust a servers response before it is parsed by other callbacks for success or failure conditions. Thanks@mnquintana


API - API now provides a local caching setting to avoid server roundtrips for identical urls by using cache: 'local'. This is not enabled by default. Local caching is useful for results that should return the same values across a single session, for example when querying an autocomplete.


Card - Cards now support multiple custom content blocks. Content blocks and images can now appear in any order.


Checkbox - Checkbox no longer require javascript to function.


Checkbox - Added support for indeterminate checkboxes, along with new stylings.


Checkbox - Now includes separate behaviors for triggering state changes without invoking callbacks set checked vs checked


Dropdown - Added remote API integration with dropdown, to allow search selection to query against a remote dataset.


Dimmer - Dimmers now have a blurring variation which apply a glass-like effect when dimmed


Dropdown - Dropdowns now automatically observe changes in menu and will update selector cache with new additions


Dropdowns - Added ability to add custom choices to all search selection dropdowns (multi/single) using allowAdditions: true setting. Search now displays error messages on no results in all cases.


Dropdown - Keyboard shortcuts have been added for selecting dropdown choices, for example "N" will scroll to "New York" in a state selection list, similar to native after initialization not being correctly applied to ui dropdown


Dropdown - Fixed issue with matching boolean values, and using set selected with trueor false


Dropdown - Fixed search dropdown submitting parent form when enter shortcut pressed


Dropdown - Fixed dropdown menu items should not center inside of a center aligned container.


Dropdown - Fixed some cases where onChange would not occur for values matching equality against '', for example 0


Form - Form will no longer set a height for textarea using the rows property


Form - inline fields are now 1em and do not match label's reduced size


Form - field inside fields no longer produce double sized margins.


Form - Form sizes and input sizes now inherit from site.variables


Form Validation - Fixed bug causing match rule not to work as expected.


Form Validation - Fixed clear and reset causing validation error to appear on checkbox if empty rule was set on checkbox.


Form Validation - Form validation now validates correctly on

频道文章

最新教程

随机推荐