Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[+] update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed Apr 23, 2018
1 parent b72a3c2 commit 6650332
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 0.6.2
- [+] [`utils`](https://alibaba.github.io/weex-ui/#/packages/utils/) more powerful, add `objToParams``paramsToObj``getPageHeight``getScreenHeight` new functions, More you can see [utils/index.js](https://github.com/alibaba/weex-ui/blob/master/packages/utils/index.js).
- [!] Fixed the bug about [`wxc-ep-slider`](https://alibaba.github.io/weex-ui/#/packages/wxc-ep-slider/) when only two sliders [pull/248].(https://github.com/alibaba/weex-ui/pull/248)
- [!] Fixed the bug about [`wxc-searchbar`](https://alibaba.github.io/weex-ui/#/packages/wxc-searchbar/) when setting up custom styles and background conflicts at the same time [issues/242](https://github.com/alibaba/weex-ui/issues/242)/[pull/245](https://github.com/alibaba/weex-ui/pull/245)
- [+] [`wxc-mask`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-mask/) Supports `top` param to control height at the top of the distance. [issues/240](https://github.com/alibaba/weex-ui/issues/240)/[pull/241](https://github.com/alibaba/weex-ui/pull/241)\
- [!] Fixed the demo bug about [`wxc-popover`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-popover/) [pull/236](https://github.com/alibaba/weex-ui/pull/236)

## 0.6.1
- [+] [`wxc-tab-page`](https://alibaba.github.io/weex-ui/#/packages/wxc-tab-page/) add `wxc-full-page` of immersion full screen effect, more you can see the component document.
- [+] [`wxc-tab-page`](https://alibaba.github.io/weex-ui/#/packages/wxc-tab-page/) add a param about `need-slider`.
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG_cn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 升级日志

## 0.6.2
- [+] [`utils`](https://alibaba.github.io/weex-ui/#/cn/packages/utils/) 功能增强,新增`objToParams``paramsToObj``getPageHeight``getScreenHeight`等功能,详细可见 [utils/index.js](https://github.com/alibaba/weex-ui/blob/master/packages/utils/index.js)
- [!] 修复 [`wxc-ep-slider`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-ep-slider/) 只有两个 slider 时候的滑动 bug [pull/248](https://github.com/alibaba/weex-ui/pull/248)
- [!] 修复 [`wxc-searchbar`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-searchbar/) 同时设置自定义样式和主题时候的背景冲突 [issues/242](https://github.com/alibaba/weex-ui/issues/242)/[pull/245](https://github.com/alibaba/weex-ui/pull/245)
- [+] [`wxc-mask`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-mask/) 支持传入 `top` 参数控制距离顶部的高度 [issues/240](https://github.com/alibaba/weex-ui/issues/240)/[pull/241](https://github.com/alibaba/weex-ui/pull/241)\
- [!] [`wxc-popover`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-popover/) demo 问题修复 [pull/236](https://github.com/alibaba/weex-ui/pull/236)


## 0.6.1
- [+] [`wxc-tab-page`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-tab-page/) 新增沉浸式全屏效果的页面切换组件 `wxc-full-page`,详细使用见组件文档
- [+] [`wxc-tab-page`](https://alibaba.github.io/weex-ui/#/cn/packages/wxc-tab-page/) 新增参数`need-slider` 控制是否需要手势滑动
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weex-ui",
"version": "0.6.2beta",
"version": "0.6.2",
"description": "A rich interaction, lightweight, high performance UI library based on Weex",
"main": "index.js",
"lib": "vue",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
!>In `weex-ui` V0.6.0 version above, in order to reduce packaging size, `Binding related judgments` are transferred from `Utils.env` to `BindEnv`.

## Rule
<img src="https://img.alicdn.com/tfs/TB1KhdgfTtYBeNjy1XdXXXXyVXa-2932-940.png" width="860"/>
<img src="https://img.alicdn.com/tfs/TB1t2Y7nN9YBuNjy0FfXXXIsVXa-2952-1096.png" width="860"/>

## Code Example

Expand Down
4 changes: 2 additions & 2 deletions packages/utils/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
!> 在 `weex-ui` V0.6.0 版本以上,为了减少打包体积,Binding 相关判断由 `Utils.env ` 转移到 `BindEnv`

## 规则
<img src="https://img.alicdn.com/tfs/TB1KhdgfTtYBeNjy1XdXXXXyVXa-2932-940.png" width="860"/>
<img src="https://img.alicdn.com/tfs/TB1t2Y7nN9YBuNjy0FfXXXIsVXa-2952-1096.png" width="860"/>

## 使用方法

Expand All @@ -17,4 +17,4 @@
// import { BindEnv } from 'weex-ui';
</script>
```
更详细代码可以参考 [utils](https://github.com/alibaba/weex-ui/blob/master/packages/utils)
更详细代码和文档可以参考 [utils](https://github.com/alibaba/weex-ui/blob/master/packages/utils)
36 changes: 36 additions & 0 deletions packages/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ const Utils = {
}
return groups;
},
/*
* 截断字符串
* @param str 传入字符串
* @param len 截断长度
* @param hasDot 末尾是否...
* @returns {String}
*/
truncateString (str, len, hasDot = true) {
let newLength = 0;
let newStr = '';
Expand All @@ -213,6 +220,35 @@ const Utils = {
}
return newStr;
},
/*
* 转换 obj 为 url params参数
* @param obj 传入字符串
* @returns {String}
*/
objToParams (obj) {
let str = "";
for (let key in obj) {
if (str !== "") {
str += "&";
}
str += key + "=" + encodeURIComponent(obj[key]);
}
return str;
},
/*
* 转换 url params参数为obj
* @param str 传入url参数字符串
* @returns {Object}
*/
paramsToObj (str) {
let obj = {};
try {
obj = JSON.parse('{"' + decodeURI(str).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}')
} catch (e) {
console.log(e);
}
return obj;
},
animation: {
/**
* 返回定义页面转场动画起初的位置
Expand Down

0 comments on commit 6650332

Please sign in to comment.