Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 07C86200D1E for ; Wed, 4 Oct 2017 06:28:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 06C58160BD7; Wed, 4 Oct 2017 04:28:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 549CF1609DE for ; Wed, 4 Oct 2017 06:28:12 +0200 (CEST) Received: (qmail 92355 invoked by uid 500); 4 Oct 2017 04:28:11 -0000 Mailing-List: contact commits-help@weex.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@weex.incubator.apache.org Delivered-To: mailing list commits@weex.incubator.apache.org Received: (qmail 92346 invoked by uid 99); 4 Oct 2017 04:28:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2017 04:28:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B40971A1240 for ; Wed, 4 Oct 2017 04:28:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id oRenoPF1Zl0H for ; Wed, 4 Oct 2017 04:28:08 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id D0C3E5FD89 for ; Wed, 4 Oct 2017 04:28:05 +0000 (UTC) Received: (qmail 91553 invoked by uid 99); 4 Oct 2017 04:28:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2017 04:28:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A854DF5843; Wed, 4 Oct 2017 04:28:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: gurisxie@apache.org To: commits@weex.incubator.apache.org Date: Wed, 04 Oct 2017 04:28:12 -0000 Message-Id: <60d7f1c391a54ed5ac6f6710380dd20a@git.apache.org> In-Reply-To: <6f05e436e1cf494aae9c17e9c80305e1@git.apache.org> References: <6f05e436e1cf494aae9c17e9c80305e1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/14] incubator-weex git commit: + [doc] update new feature documentation for image component archived-at: Wed, 04 Oct 2017 04:28:13 -0000 + [doc] update new feature documentation for image component Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b5e1fdfd Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b5e1fdfd Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b5e1fdfd Branch: refs/heads/release-0.16 Commit: b5e1fdfd0ab3824258153e6f2ecbbf1af61c78c1 Parents: be52f69 Author: acton393 Authored: Mon Oct 2 10:28:38 2017 +0800 Committer: acton393 Committed: Mon Oct 2 13:59:34 2017 +0800 ---------------------------------------------------------------------- doc/source/cn/references/components/image.md | 24 +++++++++++++++++++++++ doc/source/references/components/image.md | 22 +++++++++++++++++++++ 2 files changed, 46 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5e1fdfd/doc/source/cn/references/components/image.md ---------------------------------------------------------------------- diff --git a/doc/source/cn/references/components/image.md b/doc/source/cn/references/components/image.md index bc675cb..c096a48 100644 --- a/doc/source/cn/references/components/image.md +++ b/doc/source/cn/references/components/image.md @@ -99,6 +99,30 @@ version: 2.1 查看 [通用事件](../common-event.html) +## 组件方法 + v0.16.0+ + + - save:保存当前图片到本地 + - 参数 + 回调函数作为方法入参,接收保存结果. + ``` + var image = this.$refs.imageRef; // image 是之前已经定义过的ref +  image.save(function(result) { +  console.log(JSON.stringify(result)) + }); + ``` + - 异步返回的数据描述 + ``` + { +    "success" : true/false, // 保存成功或失败 +    "errorDesc": "errordesc" // 在success 为false的情况会返回 +  } +  ``` + - 说明 +  对于 iOS 系统需要添加 `NSPhotoLibraryAddUsageDescription`相册访问权限, iOS 11 需要再添加一个`NSPhotoLibraryAddUsageDescription`权限, [查看更多iOS系统权限](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html) +  + [试一试](http://dotwe.org/vue/fadcd44a7031943ff0feaaf1895df414) + ## 约束 1. 需要指定宽高; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b5e1fdfd/doc/source/references/components/image.md ---------------------------------------------------------------------- diff --git a/doc/source/references/components/image.md b/doc/source/references/components/image.md index cd8c59b..d0f2520 100644 --- a/doc/source/references/components/image.md +++ b/doc/source/references/components/image.md @@ -47,6 +47,28 @@ This component supports no child components. - `success` : `true` if the image was loaded successfully, otherwise `false` - `size` : the original size of image, contains two parameters: `naturalWidth` representing the original width of image in pixels, `naturalHeight` representing the original height of image in pixels. default value. The default value for both parameters is `0`. +**component method** + +- support save v0.16.0+ image to local device or photo album. + - you should specify a callback function to receive the saving result. + ``` + var image = this.$refs.imageRef; // image 是之前已经定义过的ref +   image.save(function(result) { +   console.log(JSON.stringify(result)) + }); + ``` + and the result can be the following format + ``` + { +    "success" : true/false, // 保存成功或失败 +    "errorDesc": "errordesc" // 在success 为false的情况会返回 +  } +  ``` +  - note +  you must add `NSPhotoLibraryAddUsageDescription` and `NSPhotoLibraryAddUsageDescription `(iOS 11) privacy to access photo album for iOS, [see more privacy](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html) +  + [try it for saving image](http://dotwe.org/vue/fadcd44a7031943ff0feaaf1895df414) + ### Examples ```html