You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/04/01 06:03:38 UTC

[33/50] [abbrv] incubator-weex git commit: * [html5] fix lint & add flow check for building vue-render.

* [html5] fix lint & add flow check for building vue-render.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/aab0cf17
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/aab0cf17
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/aab0cf17

Branch: refs/heads/dev
Commit: aab0cf177b77e3b5b197e0c2e912de2539a3a043
Parents: e024115
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Mar 30 14:58:04 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Mar 30 14:58:04 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/input-common.js |  2 +-
 html5/render/vue/utils/lazyload.js      | 13 ++++++-------
 package.json                            |  2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/aab0cf17/html5/render/vue/mixins/input-common.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/input-common.js b/html5/render/vue/mixins/input-common.js
index 067c8ad..7f45d6c 100644
--- a/html5/render/vue/mixins/input-common.js
+++ b/html5/render/vue/mixins/input-common.js
@@ -3,7 +3,7 @@
 // input and textare has some common api and event
 import { extend } from '../utils'
 
-const findEnterKeyType = function (key: string) : string {
+const findEnterKeyType = function (key: string): string {
   const keys = ['default', 'go', 'next', 'search', 'send']
   if (keys.indexOf(key) > -1) {
     return key

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/aab0cf17/html5/render/vue/utils/lazyload.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/lazyload.js b/html5/render/vue/utils/lazyload.js
index db3d48e..ca91d97 100644
--- a/html5/render/vue/utils/lazyload.js
+++ b/html5/render/vue/utils/lazyload.js
@@ -3,19 +3,18 @@
 import { isElementVisible } from './component'
 import { createEvent, dispatchEvent } from './event'
 import { throttle } from './func'
-import { isArray } from './type'
 import { tagImg } from './perf'
 
 const SCREEN_REC_LIMIT = 3  // just record the first 3 times for screen-render finishing.
 let doRecord = true
 
 function preLoadImg (src: string,
-  loadCallback: ?(Event) => void,
-  errorCallback: ?(Event) => void): void {
-    const img = new Image()
-    img.onload = loadCallback ? loadCallback.bind(img) : null
-    img.onerror = errorCallback ? errorCallback.bind(img) : null
-    img.src = src
+    loadCallback: ?(Event) => void,
+    errorCallback: ?(Event) => void): void {
+  const img = new Image()
+  img.onload = loadCallback ? loadCallback.bind(img) : null
+  img.onerror = errorCallback ? errorCallback.bind(img) : null
+  img.src = src
 }
 
 export function applySrc (item: HTMLElement, src: ?string, placeholderSrc: ?string): void {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/aab0cf17/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index ac7e066..c3b7784 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
     "build:runtime": "node build/build.js runtime",
     "build:browser": "wwp && node build/build.js browser",
     "build:browser:common": "rollup -c build/rollup.browser.common.config.js",
-    "build:vue": "node build/build.js vue",
+    "build:vue": "flow check && node build/build.js vue",
     "build:examples": "npm run build:examples:native && npm run build:examples:web",
     "build:examples:native": "webpack --config build/webpack.examples.config.js",
     "build:examples:web": "webpack --config build/webpack.examples.web.config.js",