Repository: incubator-weex-site
Updated Branches:
  refs/heads/asf-site 529424da5 -> 098fe0ab3


http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/098fe0ab/content/content.json
----------------------------------------------------------------------
diff --git a/content/content.json b/content/content.json
index cb90173..6641891 100644
--- a/content/content.json
+++ b/content/content.json
@@ -1 +1 @@
-{"meta":{"title":"Weex","subtitle":null,"description":"A framework for 
building Mobile cross-platform UIs. Different from a \"web app\", \"HTML5 
app\", or \"hybrid app\", you can use Weex to build a real mobile app. The code 
that you write is relatively simple, because you can build native applications 
just using HTML, CSS, Javascript. But underneath, the core of the application 
is Objective-C or Java. At the same time, Weex will provide a lot of native 
components or modules for developers to 
use.","author":"Jinjiang","url":"https://weex.apache.org"},"pages":[{"title":"Release
 
Note","path":"releasenote.html","permalink":"https://weex.apache.org/releasenote.html","text":"Release
 Notev0.13.0 Notable Changes Slider implemention is refactored Pull Request#414 
Improve integration test. We are working with macaca team, to write better test 
code.Pull Request#411 Pull Request#397 Pull Request#402 Pull Request#413 Pull 
Request#390 Pull Request#346 Pull Request#319 Pull Request#304 Pull Reque
 st#295 scroller now has pagingEnabled attribute, which can enable paging 
feature in native Pull Request#393 New ‘prerender’ mechanism, which will 
support rendering a page in background. Pull 
Request#343](https://github.com/apache/incubator-weex/pull/343) Pull 
Request#342 Fix line-height feature in iOS. Pull Request#377 Pull Request#305 
Add needLayout option in animation module operation after animation finished 
Pull Request#337 Pull Request#336 list component has new type of event for 
sticky feature Pull Request#332 Support bota and atob Pull Request#315 Fix 
mixing background-color and border-color(rgba) in android Pull Request#359 
Beside these, lots of crashes and bugs are fixed.Pull Request#441 Pull 
Request#413 Pull Request#403 Pull Request#373 v0.12.0 ( First Offical Release) 
C++ timer by lycoolDiscussed in 
https://lists.apache.org/thread.html/567c9b19d68ccf3e0d24c1467298ebcd4316ffa524c557a34c6c087f@%3Cdev.weex.apache.org%3Erelate
 pull requests:[apache/incubator-weex/pull/228
 |https://github.com/apache/incubator-weex/pull/228], 
[apache/incubator-weex/pull/232|https://github.com/apache/incubator-weex/pull/232],
 
[apache/incubator-weex/pull/221|https://github.com/apache/incubator-weex/pull/221]
 Add scroller/list scroll event in html5 renderandroid&iOS already have 
this feature in 
v0.11https://github.com/apache/incubator-weex/commit/f50fba8647c8bb6ac522b1a4569a2a2269da1953
 Enhance accessibility, new aria-label & role 
support[apache/incubator-weex/pull/149|https://github.com/apache/incubator-weex/pull/149]
 Native input/textarea enhancement by kfeagle & misakuosupport number data 
type; support soft keyboard event Picker module enhancementMore picker options 
to customize picker dialog style(background color etc.). Related pull requests: 
[apache/incubator-weex/pull/234|https://github.com/apache/incubator-weex/pull/234],
 
[apache/incubator-weex/pull/233|https://github.com/apache/incubator-weex/pull/233]
 Android DOM module refactorSeperate module code b
 y action, increasing the 
maintainability.[apache/incubator-weex/pull/104|https://github.com/apache/incubator-weex/pull/104]
 v0.10.0 New Feature Support Vue.jsThe Vue.js 2.1.8 (runtime-only build) is in 
WeexSDK now. You can use Vue.js to build native app by WeexSDK 0.10.0.We reused 
the original native render engine and developed a new renderer 
(weex-vue-render) for the web platform, which is based on Vue 2.0.The former 
front-end framework (commonly known as .we), which is inspired by Vue 1.0, is 
deprecated. Although it still works well in this release, we suggest to migrate 
it to Vue 2.0. SDK New CSS support text font-weightfont-weight can set to 
[normal|bold] or 100-900. gradientlike CSS3, now you can use gradient in Weex. 
For example: background-image: linear-gradient(to right, blue, white); Read 
more about gradient. Pseudo classCurrently, Weex supports 4 pseudo 
classes:active, focus, disabled, enabled. New BroadcastChannel APIDevelopers 
can use BroadcastChannel API to implement in
 ter-instance communication. const Stack = new 
BroadcastChannel('Avengers')Stack.onmessage = function (event) { 
console.log(event.data) // in this case, it's \"Hulk Smash !!!\"}// in 
another instanceconst Hulk = new 
BroadcastChannel('Avengers')Hulk.postMessage(\"Hulk Smash !!!\") Image’s 
onload event add naturalHeight and naturalWidthimage to get the original size 
of image file. Websocket SupportWebSockets is an advanced technology that makes 
it possible to open an interactive communication session between the user’s 
h5/iOS/android and a server. With this API, you can send messages to a server 
and receive event-driven responses without having to poll the server for a 
reply.Read more about Weex’s websocket. Support synchronous method callBoth 
module and component method can defined synchronous method exposed to JS 
runtime now. Means native will invoke these method in JS thread directly. 
Support viewport configurationSimilar to W3C specification, Weex support set 
define
  viewport in script tag: <script type=\"config\"> { \"viewport\": 
{ \"width\": \"device-width\" } }</script> Tools Devtools 
Support Vue 2.0 debugging. Add network switch for network inspector. Make 
application capable to decide which bundle is ‘un-debuggable’, which means 
page’s source code is unreadable in debug mode. Weexpack Has full set of 
commands for developers to setup android/ios application with his .we/.vue 
files. Developers could easily pack/install his application with simple 
command. Has full set of commands for developers to manage weex plugins, 
including create plugin template, add plugin to his project etc. Plugin market 
was formally used for developers to publish/download weex plugins. v0.9.4 New 
features SDK New API to get Component’s size and position:Now you can get 
these data through getComponentRect: var dom = 
require('@weex-module/dom');dom.getComponentRect(this.$el('comp_id'), 
function(data){ if(data.result) consol
 e.log(data);}); The data callback parameter contains a result to tell if 
operation is success. And size tell you the true 
data(bottom/top/left/right/width/height) of component. A brand new picker 
module. We have ‘single-picker’,’date-picker’ and ‘time-picker’ 
currently, and more common pickers are on the way.There are two ways to use 
picker Use picker module directly: var picker = 
require('@weex-module/picker');var self = this;picker.pickDate({ 
'value':'2016-11-28', 'max':'2029-11-28', 'min':'2015-11-28'},function 
(ret) { var result = ret.result; if(result == 'success') { self.value 
= ret.data; }}); input component also add ‘date’ and ‘timetype 
to work withpicker` module internally: <input type=\"date\" 
placeholder=\"select date\" class=\"input\" autofocus=\"false\" value=\"\" 
onchange=\"onchange\" max = \"2029-11-28\" min = \"2015-11-28\" 
></input> Support animation with width and height property. Support 
use empty va
 lue to reset css property to default value. Components can expose methods too, 
like modules do. Developers use the same way as create module method to achieve 
that. Add blur and focus method to manually control input component to lose or 
get focus. Support relative URL, which will resolve real URL by bundle’s URL. 
Core javascript framework’s unit test coverage is 100% now. we’ll pay more 
attention to quality. DevTool Support to check the node hierarchy in 
weex-devtool-extension and highlight the node if it exceeds an specified level. 
Support different refresh mode in devtools to reload the page or SDK 
automatically when source file updated. Improve quality in 
weex-devtools-android module Remove explicit dependency on okhttp and okhttp3 
by reflection and proxy Improve demo application with less and refactored code 
Fix some crash caused by class up cast Fix reflection crash caused by complier 
optimization Fix “network on main thread” and stop screencast when 
disconnect Add w
 eex-analyzer-android and weex-analyzer-ios which support the following on 
device directly: Inspect FPS/CPU/memory Inspect storage Display log information 
3D viewer of the weex page Javascript error prompt v0.8.0 New Features Add 
globalEvent module Support width/height animation in transition Refactor the 
default js framework code, hide almost all the private APIs #777 iOS 10 
compatibility Performance Support callAddElement low-level API to make 
rendering faster Improve SDK initialization performance, for minimise invoke 
thread impact. Use native Set polyfill to fix iOS7 memory leak Use setProperty 
replace reflection for better performance Add static directive in default js 
framework to avoid unnecessary data-binding and take down the memory use Tools 
Add weex-pack, our next generation of engineering development kits. It allows 
developers to create weex projects with simple commands and run the project on 
different development platforms. Add weex-devtool-extension, a extension for We
 ex devtool to improve your debug experience,which equivalent an element tag 
for debugger page. Move devtool to separate iOS and Android repos. Add 
“screencast” which enable the screen of the device(or monitor) to appear on 
the “Inspector” page; Add “remote control” function, in Android user 
could control remote device(or monitor) when he moves mouse on screencast; Add 
“select element” function which enable the user to find the exact node in 
“Elements” inspector Tab when he click the mouse on screencast; Add “vdom 
inspector”, so user can choose to see the details of native dom or vdom in 
“Elements” Tab at his preference; Adjust interfaces with weex SDK to 
support “callAddElement”; v0.7.0 New Features Timer Module Storage Module 
Unify the image component’s error page when src is invalid Unify the 
border,padding,background-color style Horizontal-scroller support scrollto api 
Fix the issue that component with position:fixed style can not be closed Mod
 ule callback support object params Slider suppport setIndex api Performance 
Use callNative signal to stop JSFM render after instance been destroyed Lazily 
initialize JSFM When device is in low-memory status, improve SDK stability 
Tools Support debugging weex(.we) and react(.jsx) source Support apps debugging 
on the same device Support “watch” feature Solve the dependency on 
Debugger, user could start “Inspector” first or “Debugger” at will Add 
“refresh” function in sdk, user could inspect new file by scanning its QR 
code in playground; Android/ios inspect module split from weex sdk, and will 
deliver in separate repo in future; support inspect in windows system v0.6.1 
New Features iOS has been open sourced Lifecycle Page Event: viewappear, 
viewdisappear fetch line-height list component support sticky header support 
scrollToElement API support nested horizontal scroller support cell children 
nodes event: appear/disappear Gesture: panstart/panmove/panend, swipe, longpre
 ss Improve Android text compatibility Performance iOS, iPhone 5c, rendering 
frame rate ascends from 45FPS to 52FPS Android, Redmi Note 1, loading time of 
the first screen descends from 602ms to 480ms Improve Android animation 
performance Tools weex-toolkit supports require and generator Playground 
supports runtime performance viewer Weex DevTools v0.5.0 New Features TabBar is 
a specialized component corresponding to the radio-style selection. NavPage 
contains a navbar at the top of the window and an embed content page. Activity 
Showcase is built by composing TabBar and NavPage. Web displays web content in 
the weex page. A defines a hyperlink to a page in the web. Text supports style 
text-overflow. Image supports attribute resize. List supports events appear, 
disappear, loadmore and refresh. New Syntax Inline event supports a expression 
of calling event handler in template. Require Native Module requires a native 
module by require('@weex-module/moduleName'). Computed Property
  supports complicated logic in data bindings. New Repeat Syntax is easy to 
access the key or value of repeated 
object.","type":"releasenote"},{"title":"Release 
Note","path":"cn/releasenote.html","permalink":"https://weex.apache.org/cn/releasenote.html","text":"Release
 Notev0.13.0 Notable Changes Slider implemention is refactored Pull Request#414 
Improve integration test. We are working with macaca team, to write better test 
code.Pull Request#411 Pull Request#397 Pull Request#402 Pull Request#413 Pull 
Request#390 Pull Request#346 Pull Request#319 Pull Request#304 Pull Request#295 
scroller now has pagingEnabled attribute, which can enable paging feature in 
native Pull Request#393 New ‘prerender’ mechanism, which will support 
rendering a page in background. Pull 
Request#343](https://github.com/apache/incubator-weex/pull/343) Pull 
Request#342 Fix line-height feature in iOS. Pull Request#377 Pull Request#305 
Add needLayout option in animation module operation after animation finished
  Pull Request#337 Pull Request#336 list component has new type of event for 
sticky feature Pull Request#332 Support bota and atob Pull Request#315 Fix 
mixing background-color and border-color(rgba) in android Pull Request#359 
Beside these, lots of crashes and bugs are fixed.Pull Request#441 Pull 
Request#413 Pull Request#403 Pull Request#373 v0.12.0 ( First Offical Release) 
C++ timer by lycoolDiscussed in 
https://lists.apache.org/thread.html/567c9b19d68ccf3e0d24c1467298ebcd4316ffa524c557a34c6c087f@%3Cdev.weex.apache.org%3Erelate
 pull 
requests:[apache/incubator-weex/pull/228|https://github.com/apache/incubator-weex/pull/228],
 
[apache/incubator-weex/pull/232|https://github.com/apache/incubator-weex/pull/232],
 
[apache/incubator-weex/pull/221|https://github.com/apache/incubator-weex/pull/221]
 Add scroller/list scroll event in html5 renderandroid&iOS already have 
this feature in 
v0.11https://github.com/apache/incubator-weex/commit/f50fba8647c8bb6ac522b1a4569a2a2269da1953
 Enhance acces
 sibility, new aria-label & role 
support[apache/incubator-weex/pull/149|https://github.com/apache/incubator-weex/pull/149]
 Native input/textarea enhancement by kfeagle & misakuosupport number data 
type; support soft keyboard event Picker module enhancementMore picker options 
to customize picker dialog style(background color etc.). Related pull requests: 
[apache/incubator-weex/pull/234|https://github.com/apache/incubator-weex/pull/234],
 
[apache/incubator-weex/pull/233|https://github.com/apache/incubator-weex/pull/233]
 Android DOM module refactorSeperate module code by action, increasing the 
maintainability.[apache/incubator-weex/pull/104|https://github.com/apache/incubator-weex/pull/104]
 v0.10.0 New Feature Support Vue.jsThe Vue.js 2.1.8 (runtime-only build) is in 
WeexSDK now. You can use Vue.js to build native app by WeexSDK 0.10.0.We reused 
the original native render engine and developed a new renderer 
(weex-vue-render) for the web platform, which is based on Vue 2.0.The for
 mer front-end framework (commonly known as .we), which is inspired by Vue 1.0, 
is deprecated. Although it still works well in this release, we suggest to 
migrate it to Vue 2.0. SDK New CSS support text font-weightfont-weight can set 
to [normal|bold] or 100-900. gradientlike CSS3, now you can use gradient in 
Weex. For example: background-image: linear-gradient(to right, blue, white); 
Read more about gradient. Pseudo classCurrently, Weex supports 4 pseudo 
classes:active, focus, disabled, enabled. New BroadcastChannel APIDevelopers 
can use BroadcastChannel API to implement inter-instance communication. const 
Stack = new BroadcastChannel('Avengers')Stack.onmessage = function (event) 
{ console.log(event.data) // in this case, it's \"Hulk Smash !!!\"}// 
in another instanceconst Hulk = new 
BroadcastChannel('Avengers')Hulk.postMessage(\"Hulk Smash !!!\") Image’s 
onload event add naturalHeight and naturalWidthimage to get the original size 
of image file. Websocket SupportWebSocke
 ts is an advanced technology that makes it possible to open an interactive 
communication session between the user’s h5/iOS/android and a server. With 
this API, you can send messages to a server and receive event-driven responses 
without having to poll the server for a reply.Read more about Weex’s 
websocket. Support synchronous method callBoth module and component method can 
defined synchronous method exposed to JS runtime now. Means native will invoke 
these method in JS thread directly. Support viewport configurationSimilar to 
W3C specification, Weex support set define viewport in script tag: <script 
type=\"config\"> { \"viewport\": { \"width\": \"device-width\" 
} }</script> Tools Devtools Support Vue 2.0 debugging. Add 
network switch for network inspector. Make application capable to decide which 
bundle is ‘un-debuggable’, which means page’s source code is unreadable 
in debug mode. Weexpack Has full set of commands for developers to setup a
 ndroid/ios application with his .we/.vue files. Developers could easily 
pack/install his application with simple command. Has full set of commands for 
developers to manage weex plugins, including create plugin template, add plugin 
to his project etc. Plugin market was formally used for developers to 
publish/download weex plugins. v0.9.4 New features SDK New API to get 
Component’s size and position:Now you can get these data through 
getComponentRect: var dom = 
require('@weex-module/dom');dom.getComponentRect(this.$el('comp_id'), 
function(data){ if(data.result) console.log(data);}); The data 
callback parameter contains a result to tell if operation is success. And size 
tell you the true data(bottom/top/left/right/width/height) of component. A 
brand new picker module. We have ‘single-picker’,’date-picker’ and 
‘time-picker’ currently, and more common pickers are on the way.There are 
two ways to use picker Use picker module directly: var picker = 
require('@weex-mo
 dule/picker');var self = this;picker.pickDate({ 'value':'2016-11-28', 
'max':'2029-11-28', 'min':'2015-11-28'},function (ret) { var result = 
ret.result; if(result == 'success') { self.value = ret.data; 
}}); input component also add ‘date’ and ‘timetype to work 
withpicker` module internally: <input type=\"date\" placeholder=\"select 
date\" class=\"input\" autofocus=\"false\" value=\"\" onchange=\"onchange\" max 
= \"2029-11-28\" min = \"2015-11-28\" ></input> Support animation with 
width and height property. Support use empty value to reset css property to 
default value. Components can expose methods too, like modules do. Developers 
use the same way as create module method to achieve that. Add blur and focus 
method to manually control input component to lose or get focus. Support 
relative URL, which will resolve real URL by bundle’s URL. Core javascript 
framework’s unit test coverage is 100% now. we’ll pay more attention to 
quality.
  DevTool Support to check the node hierarchy in weex-devtool-extension and 
highlight the node if it exceeds an specified level. Support different refresh 
mode in devtools to reload the page or SDK automatically when source file 
updated. Improve quality in weex-devtools-android module Remove explicit 
dependency on okhttp and okhttp3 by reflection and proxy Improve demo 
application with less and refactored code Fix some crash caused by class up 
cast Fix reflection crash caused by complier optimization Fix “network on 
main thread” and stop screencast when disconnect Add weex-analyzer-android 
and weex-analyzer-ios which support the following on device directly: Inspect 
FPS/CPU/memory Inspect storage Display log information 3D viewer of the weex 
page Javascript error prompt v0.8.0 New Features Add globalEvent module Support 
width/height animation in transition Refactor the default js framework code, 
hide almost all the private APIs #777 iOS 10 compatibility Performance Support 
callAd
 dElement low-level API to make rendering faster Improve SDK initialization 
performance, for minimise invoke thread impact. Use native Set polyfill to fix 
iOS7 memory leak Use setProperty replace reflection for better performance Add 
static directive in default js framework to avoid unnecessary data-binding and 
take down the memory use Tools Add weex-pack, our next generation of 
engineering development kits. It allows developers to create weex projects with 
simple commands and run the project on different development platforms. Add 
weex-devtool-extension, a extension for Weex devtool to improve your debug 
experience,which equivalent an element tag for debugger page. Move devtool to 
separate iOS and Android repos. Add “screencast” which enable the screen of 
the device(or monitor) to appear on the “Inspector” page; Add “remote 
control” function, in Android user could control remote device(or monitor) 
when he moves mouse on screencast; Add “select element” function whi
 ch enable the user to find the exact node in “Elements” inspector Tab when 
he click the mouse on screencast; Add “vdom inspector”, so user can choose 
to see the details of native dom or vdom in “Elements” Tab at his 
preference; Adjust interfaces with weex SDK to support “callAddElement”; 
v0.7.0 New Features Timer Module Storage Module Unify the image component’s 
error page when src is invalid Unify the border,padding,background-color style 
Horizontal-scroller support scrollto api Fix the issue that component with 
position:fixed style can not be closed Module callback support object params 
Slider suppport setIndex api Performance Use callNative signal to stop JSFM 
render after instance been destroyed Lazily initialize JSFM When device is in 
low-memory status, improve SDK stability Tools Support debugging weex(.we) and 
react(.jsx) source Support apps debugging on the same device Support 
“watch” feature Solve the dependency on Debugger, user could start 
“Inspect
 or” first or “Debugger” at will Add “refresh” function in sdk, user 
could inspect new file by scanning its QR code in playground; Android/ios 
inspect module split from weex sdk, and will deliver in separate repo in 
future; support inspect in windows system v0.6.1 New Features iOS has been open 
sourced Lifecycle Page Event: viewappear, viewdisappear fetch line-height list 
component support sticky header support scrollToElement API support nested 
horizontal scroller support cell children nodes event: appear/disappear 
Gesture: panstart/panmove/panend, swipe, longpress Improve Android text 
compatibility Performance iOS, iPhone 5c, rendering frame rate ascends from 
45FPS to 52FPS Android, Redmi Note 1, loading time of the first screen descends 
from 602ms to 480ms Improve Android animation performance Tools weex-toolkit 
supports require and generator Playground supports runtime performance viewer 
Weex DevTools v0.5.0 New Features TabBar is a specialized component 
corresponding t
 o the radio-style selection. NavPage contains a navbar at the top of the 
window and an embed content page. Activity Showcase is built by composing 
TabBar and NavPage. Web displays web content in the weex page. A defines a 
hyperlink to a page in the web. Text supports style text-overflow. Image 
supports attribute resize. List supports events appear, disappear, loadmore and 
refresh. New Syntax Inline event supports a expression of calling event handler 
in template. Require Native Module requires a native module by 
require('@weex-module/moduleName'). Computed Property supports 
complicated logic in data bindings. New Repeat Syntax is easy to access the key 
or value of repeated object.","type":"releasenote"},{"title":"How to 
Contribute","path":"guide/contributing.html","permalink":"https://weex.apache.org/guide/contributing.html","text":"How
 to ContributeWelcome to create pull requests or join in our mailing list for 
bugfix, doc, example, suggestion and anything. Join in Weex Mai
 ling ListIn Weex community all discussion will happen on mailing list. Just 
send an email to dev-subscr...@weex.incubator.apache.org and follow the 
instructions to subscribe Weex dev mailing list. And then you will receive all 
discussions and community messages by your personal email. In the same time you 
can freely send your own emails to join in us. At the same time you can see the 
archives of all the mails through the web: 
http://mail-archives.apache.org/mod_mbox/incubator-weex-dev/ If you won’t 
follow the mailing list any more. There is another way to unsubscribe it: send 
an email to dev-unsubscr...@weex.incubator.apache.org and follow the 
instructions. Besides Weex dev mailing list, we also have some other mailing 
lists for you. You can check them out here: 
http://mail-archives.apache.org/mod_mbox/#weex.incubator Branch 
Managementmaster ↑dev <--- PR(hotfix/typo/3rd-PR) ↑ 
PR{domain}-feature-{date} master branch master is the 
latest (pre-)release bran
 ch. dev branch dev is the stable developing branch. It’s RECOMMENDED to 
commit hotfix (like typo) or feature PR to dev. {domain}-feature-{date} branch 
The branch for a developing iteration, e.g. android-feature-20160607 is an 
android developing iteration which is done at 2016.06.07. {domain} consists of 
android, ios, jsfm and html5. DO NOT commit any PR to such a branch. Branch 
Name{module}-{action}-{shortName} {module}, see 
commit log module {action} feature: checkout from {module} and merge to 
{module} later. If {module} not exists, merge to dev bugfix: like feature, for 
bugfix only hotfix: checkout from master or release tag, merge to master and 
{module} later. If {module} not exists, merge to dev for example: 
android-bugfix-memory jsfm-feature-communication android-hotfix-compute-layout 
Commit Log{action} [{module}] {description} 
{action} + add * update or bugfix - remove {module} Including: android, ios, 
jsfm, html5,
  component, doc, website, example, test, all {description} Just make it as 
clear and simple as possible. for example: + [android] close #123, add 
refreshing for WebView * [doc] fix #123, update video auto-play property - 
[example] remove abc Pull RequestYou can create pull requests in GitHub. First 
we suggest you have some discussion with the community (commonly in our mailing 
list) before you code. Fork repo from https://github.com/apache/incubator-weex/ 
Finish the job you want to do. Create a pull request. Code Style 
GuideObjective-C Tabs for indentation(not spaces) * operator goes with the 
variable name (e.g. Type *variable;) Function definitions: place each brace on 
its own line. Other braces: place the open brace on the line preceding the code 
block; place the close brace on its own line. Use #pragma marks to categorize 
methods into functional groupings and protocol implementations Follow other 
guidelines on GitHub Objective-C Style Guide Java & Android Use Google Java 
Styl
 e as basic guidelines of java code. Follow AOSP Code Style for rest of android 
related code style.","type":"guide"},{"title":"Integrate to Your 
App","path":"guide/integrate-to-your-app.html","permalink":"https://weex.apache.org/guide/integrate-to-your-app.html","text":"Integrate
 to Your AppIntegrate to AndroidTip:The following documents assume that you 
already have a certain Android development experience. Android has two ways to 
integrate weex1.using source code: Can quickly use the latest features of WEEX, 
according to your own characteristics of the project. So, you can do some 
related improvements. 2.using SDK: WEEX will regularly release a stable version 
at jcenter.jcenter PrerequisitesMake sure the following configuration is 
complete: JDK version >= 1.7 , and configure the environment variable 
Android SDK installed and configure the environment variable Android SDK 
version 23 (compileSdkVersion in build.gradle) SDK build tools version 23.0.1 
(buildToolsVersion in build.gr
 adle) Android Support Repository >= 17 (for Android Support Library) Quick 
to useIf you are the first time to try or have a higher demand for stability, 
you can use the way to dependence on the SDK.The steps are as follows: Create 
an Android project. There is nothing to be specified, according to your habits 
to. Update build.gradle by adding the following dependencies: compile 
'com.android.support:recyclerview-v7:23.1.1'compile 
'com.android.support:support-v4:23.1.1'compile 
'com.android.support:appcompat-v7:23.1.1'compile 
'com.alibaba:fastjson:1.1.46.android'compile 
'com.taobao.android:weex_sdk:0.5.1@aar' Note: the version can be high can not 
be low. Start writing codeNote: There is a complete code address in the 
appendix Implement the picture download interface, set the initialization. 
package com.weex.sample;import android.widget.ImageView;import 
com.taobao.weex.adapter.IWXImgLoaderAdapter;import 
com.taobao.weex.common.WXImageStrategy;import 
com.taobao.weex.dom.WXImageQuality;/
 *** Created by lixinke on 16/6/1.*/public class ImageAdapter implements 
IWXImgLoaderAdapter { @Override public void setImage(String url, ImageView 
view, WXImageQuality quality, WXImageStrategy strategy) { //To implement 
picture download interface, otherwise the picture can not be displayed. 
}} initialization package com.weex.sample;import 
android.app.Application;import com.taobao.weex.InitConfig;import 
com.taobao.weex.WXSDKEngine;/*** Note: add android:name=\".WXApplication\" into 
Manifest file* To implement ImageAdapter, otherwise the picture can not be 
downloaded* Gradle must add some dependencies, otherwise the initialization 
will fail.* compile 'com.android.support:recyclerview-v7:23.1.1'* compile 
'com.android.support:support-v4:23.1.1'* compile 
'com.android.support:appcompat-v7:23.1.1'* compile 
'com.alibaba:fastjson:1.1.45'*/public class WXApplication extends Application 
{ @Override public void onCreate() { super.onCreate(); InitConfig 
config=new I
 nitConfig.Builder().setImgAdapter(new ImageAdapter()).build(); 
WXSDKEngine.initialize(this,config); }} Start rendering package 
com.weex.sample;import android.os.Bundle;import 
android.support.v7.app.AppCompatActivity;import android.view.View;import 
com.taobao.weex.IWXRenderListener;import com.taobao.weex.WXSDKInstance;import 
com.taobao.weex.common.WXRenderStrategy;import 
com.taobao.weex.utils.WXFileUtils;public class MainActivity extends 
AppCompatActivity implements IWXRenderListener { WXSDKInstance 
mWXSDKInstance; @Override protected void onCreate(Bundle savedInstanceState) 
{ super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_main); mWXSDKInstance = new 
WXSDKInstance(this); mWXSDKInstance.registerRenderListener(this); /** * 
WXSample can be replaced by any string * Template is js file that .we converted 
* Option can be empty, or through the option passed js required parameters. 
Such as the address of the bundle js. * JsonInitData can be empty. * 
 width is -1 , default full screen, you can customize it. * height is -1 , 
default full screen, you can customize it. */ 
mWXSDKInstance.render(\"WXSample\", WXFileUtils.loadFileContent(\"hello.js\", 
this), null, null, -1, -1, WXRenderStrategy.APPEND_ASYNC); } @Override 
public void onViewCreated(WXSDKInstance instance, View view) { 
setContentView(view); } @Override public void 
onRenderSuccess(WXSDKInstance instance, int width, int height) { } 
@Override public void onRefreshSuccess(WXSDKInstance instance, int width, int 
height) { } @Override public void onException(WXSDKInstance instance, 
String errCode, String msg) { } @Override protected void onResume() 
{ super.onResume(); if(mWXSDKInstance!=null){ 
mWXSDKInstance.onActivityResume(); } } @Override protected void 
onPause() { super.onPause(); if(mWXSDKInstance!=null){ 
mWXSDKInstance.onActivityPause(); } } @Override protected void 
onStop() { super.o
 nStop(); if(mWXSDKInstance!=null){ mWXSDKInstance.onActivityStop(); 
} } @Override protected void onDestroy() { super.onDestroy(); 
if(mWXSDKInstance!=null){ mWXSDKInstance.onActivityDestroy(); } 
}} Dependence on source code (IDE Android Studio)1.Download source 
code. git clone https://github.com/alibaba/weex.2.Create an android 
project.3.Import the SDK Module through the following path:File->New-Import 
Module-> chose WEEX SDK Module(weex/android/sdk) -> Finish4.Add the 
following dependencies: compile project (‘: weex_sdk’) to build.gradle 
file.5.Other settings please refer to the above “Quick to use”. Appendix: 
WXSample address https://github.com/xkli/WXSample.git Integrated to iOSThrough 
the cocoaPods integrated Weex iOS SDK to the project.First assume that you have 
finished installing the iOS development environment and CocoaPods. Step 1: Add 
DependenciesImport Weex iOS SDK to your existing project, if not, you can 
create a n
 ew project.Before proceeding, make sure that the Podfile file is under the 
project file. If not, create one and open with text editor. Integration 
framework WeexSDK The latest version on cocoaPods can be obtained here .Add the 
following to the Podfile file: source 
'g...@github.com:CocoaPods/Specs.git' target 'YourTarget' 
do platform :ios, '7.0' pod 'WeexSDK', '0.9.5' ## 
Suggest using latest Weex SDKend Integrate with source code First copy the ios 
/ sdk directory to your existing project directory (here to copy the root 
directory of your existing project as an example), and then add the Podfile 
file. source 'g...@github.com:CocoaPods/Specs.git' target 
'YourTarget' do platform :ios, '7.0' pod 
'WeexSDK', :path=>'./sdk/' end Step 2: Install 
DependenciesOpen the command line, switch to the directory of the Podfile file, 
and run the pod install command. If there are no errors, it means th
 at the environment has been configured. Step 3: Initialize the Weex 
environmentIn the AppDelegate.m file to do the initialization operation, 
usually in the didFinishLaunchingWithOptions method as follows to add. 
//business configuration[WXAppConfiguration 
setAppGroup:@"AliApp"];[WXAppConfiguration 
setAppName:@"WeexDemo"];[WXAppConfiguration 
setAppVersion:@"1.0.0"];//init sdk enviroment [WXSDKEngine 
initSDKEnviroment];//register custom module and 
component,optional[WXSDKEngine registerComponent:@"MyView" 
withClass:[MyViewComponent class]];[WXSDKEngine 
registerModule:@"event" withClass:[WXEventModule class]];//register 
the implementation of protocol, optional[WXSDKEngine 
registerHandler:[WXNavigationDefaultImpl new] 
withProtocol:@protocol(WXNavigationProtocol)];//set the log level [WXLog 
setLogLevel: WXLogLevelAll]; Step 4: Render weex InstanceWeex supports both 
full page rendering and partial rendering. What you need to do is render
  Weex’s view with the specified URL and add it to its parent container. The 
parent container is generally a viewController. #import 
<WeexSDK/WXSDKInstance.h>- (void)viewDidLoad { [super viewDidLoad]; 
_instance = [[WXSDKInstance alloc] init]; _instance.viewController = self; 
_instance.frame = self.view.frame; __weak typeof(self) weakSelf = self; 
_instance.onCreate = ^(UIView *view) { [weakSelf.weexView 
removeFromSuperview]; weakSelf.weexView = view; [weakSelf.view 
addSubview:weakSelf.weexView]; }; _instance.onFailed = ^(NSError *error) 
{ //process failure }; _instance.renderFinish = ^ (UIView *view) 
{ //process renderFinish }; NSURL *url = [[NSBundle mainBundle] 
URLForResource:@"main" withExtension:@"js"] [_instance 
renderWithURL:url options:@{@"bundleUrl":[self.url 
absoluteString]} data:nil];} WXSDKInstance is a very important class 
that provides a basic method and some callbacks, such as renderW
 ithURL, onCreate, onFailed, etc., can be found in WXSDKInstance.h. Step 5: 
Destroy Weex InstanceIn the dealloc phase of the viewController destroyed Weex 
instance, can play a role in avoiding memory leaks. - (void)dealloc{ 
[_instance destroyInstance];} Import the Weex SDK framework to the 
project.The Weex SDK can be compiled from the source code. You can try the 
latest feature in the new feature or bugfix branch.Refer to here for direct 
import of weexSDK.","type":"guide"},{"title":"Set Up Development 
Environment","path":"guide/set-up-env.html","permalink":"https://weex.apache.org/guide/set-up-env.html","text":"Set
 up development environmentUse dotWe is a good choice, But if you want to 
develop locally on your own machine, you will set up your development 
environment. You will need Node.js and the Weex CLi. You can installing Node 
using nvm (Simple bash script to manage multiple active node.js versions). Run 
the following commands in a Terminal after installing nvm: $ nvm i
 nstall 6.10.0$ nvm use 6.10.0 Node.js comes with npm, which lets you install 
the Weex Cli. Run the following command in a Terminal: $ npm install -g 
weex-toolkit$ weex -vv1.0.3weex-builder : v0.2.4weex-previewer : v1.3.4 NOTE: 
If you get an error like “permission error”, try installing with sudo. Then 
you can use the weex command to verify that the installation is successful: 
Generate a new Weex projectYou can use CLi to generate a Weex project called 
“awesome-project”. Run the following command in a Terminal: $ weex init 
awesome-project Then we enter the awesome-project folder, the CLi has been for 
us to generate a standard project structure. UsageWe enter the awesome-project 
folder and install dependencies with the following commands: npm install Then 
we run npm run dev and npm run serve to start watch mode and static server. 
Finally, we can see the Weex page in http://localhost:8080/index.html. You can 
modify this page in src/foo.vue. The code is shown below: <template
 > <div class=\"wrapper\"> <text class=\"weex\">Hello Weex 
!</text> <text class=\"vue\">Hello Vue !</text> 
</div></template><style scoped> .wrapper { 
flex-direction: column; justify-content: center; } .weex { font-size: 
60px; text-align: center; color: #1B90F7; } .vue { font-size: 60px; 
text-align: center; margin-top: 30px; color: #41B883; }</style> If 
you’re curious to learn more about technical details, continue on to the 
next. And don’t forget to write code at dotWe and preview at 
anytime.","type":"guide"},{"title":"Android 
APIs","path":"references/android-apis.html","permalink":"https://weex.apache.org/references/android-apis.html","text":"Android
 APIsWXSDKEngine Set up various adapters WXSDKEngine.initialize(this, new 
InitConfig.Builder().setImgAdapter(new ImageAdapter()).setDebugAdapter(new 
PlayDebugAdapter()).build()); Register the module and component 
WXSDKEngine.registerComponent(\"ric
 htext\", RichText.class);WXSDKEngine.registerModule(\"event\", 
WXEventModule.class); Overloading framework 
WXSDKEngine.reload(this,framework,false); Adapter IWXImgLoaderAdapter Weex need 
to implement this interface to download the pictureThe interface is defined as 
follows: public interface IWXImgLoaderAdapter { void setImage(String url, 
ImageView view, WXImageQuality quality, WXImageStrategy strategy);} 
WXImageQuality that the quality of the picture variables, take the following 
values LOW, NORMAL, HIGH, ORIGINAL picture quality in turn higher. The default 
is LOW. WXImageStrategy is an extension class that indicates whether the image 
can be cut (isClipping) sharpening (isSharpen) placeholder (placeHolder) and so 
on. IWXHttpAdapter Weex custom WXRequest and OnHttpListener, Native reload 
interface can be obtained from the Request URL, Header and other parameters, 
the network request can be completed through OnHttpListener callback 
notification. Weex provides the default net
 work request: DefaultWXHttpAdapter, using HttpURLConnection for network 
requests. The interface is defined as follows: public interface IWXHttpAdapter 
{ void sendRequest(WXRequest request, OnHttpListener listener);} 
WXRequest defines the parameters related to the network request, the request 
method, the request body, and the timeout time. Weex default timeout is 3000. 
OnHttpListener defines the corresponding method after the network request ends. 
Defined as follows: interface OnHttpListener { /** * start request */ void 
onHttpStart(); /** * headers received */ void onHeadersReceived(int 
statusCode,Map<String,List<String>> headers); /** * post progress * 
@param uploadProgress */ void onHttpUploadProgress(int uploadProgress); /** * 
response loaded length (bytes), full length should read from headers 
(content-length) * @param loadedLength */ void onHttpResponseProgress(int 
loadedLength); /** * http response finish * @param response */ void 
onHttpFinish(WXResp
 onse response); } IWXUserTrackAdapter Weex related performance data 
(first screen loading time, JS-Native communication time, dom update time, 
etc.) and other general information (JSLib file size, Weex SDK version number, 
etc.).Interface definition: public interface IWXUserTrackAdapter { void 
commit(Context context, String eventId, String type, WXPerformance perf, 
Map<String, Serializable> params);} Native implementation interface 
can be obtained through WXPerformance and params corresponding information. 
Native interacts with JavaScriptCustom eventsUsed for a custom control for 
event notifications, such as custom click events, response drop events, and so 
on. WXSDKInstance.java public void fireEvent(String elementRef,final String 
type, final Map<String, Object> data,final Map<String, Object> 
domChanges){ }public void fireEvent(String elementRef,final String 
type, final Map<String, Object> data){ 
fireEvent(elementRef,type,data,nu
 ll);}public void fireEvent(String elementRef, String type){ 
fireEvent(ref,type,new HashMap<String, Object>());} elementRef:The 
event occurred for the control ID。 type: Custom events, Weex defaults to a 
custom event starting with onXxxxx. OnPullDown (drop-down event) data: Need to 
reveal the parameters, such as the current control of the size, coordinates and 
other information。 domChanges:Update ref for the control’s Attribute and 
Style Event callbackUsed for Module callback, for example, after the completion 
of positioning Module need to notify JS. Use as follows: public class 
WXLocation extends WXModule { @JSMethod public void getLocation(JSCallback 
callback){ //Get the code for the location information ..... 
Map<String,String> data=new HashMap<>(); data.put(\"x\",\"x\"); 
data.put(\"y\",\"y\"); //notify once callback.invoke(data); //Continuous 
connection callback.invokeAndKeepAlive(data); //Invoke method and 
invokeAndKeepAlive tw
 o methods of choice }} OnWXScrollListenerWeex gets the scroll event 
You can register registerOnWXScrollListener via WXSDKInstanceThe interface is 
defined as follows: public interface OnWXScrollListener { /** * The view 
is not currently scrolling. */ int IDLE = RecyclerView.SCROLL_STATE_IDLE; /** * 
The view is currently being dragged by outside input such as user touch input. 
*/ int DRAGGING = RecyclerView.SCROLL_STATE_DRAGGING; /** * The view is 
currently animating to a final position while not under * outside control. */ 
int SETTLING = RecyclerView.SCROLL_STATE_SETTLING; /** * Callback method to be 
invoked when the view has been scrolled. This will be * called after the scroll 
has completed. * <p> * This callback will also be called if visible item 
range changes after a layout * calculation. In that case, dx and dy will be 0. 
* */ void onScrolled(View view, int x, int y); /** * Callback method to be 
invoked when view's scroll state changes. * */ void onScrollSt
 ateChanged(View view, int x, int y, int newState);} 
IActivityNavBarSetterWeex provides WXNavigatorModule for navigation control, 
and the corresponding method can be customized by setting the 
IActivityNavBarSetter interface. Instructions: 
WXSDKEngine.setActivityNavBarSetter(new IActivityNavBarSetter(){}); 
Other IntroductionsetSizeYou can use the mWXSDKInstance.setSize() method to 
change the size of the Weex container. DowngradeWeex in the development stage 
will add some new features and new methods, but these new features and 
functions must be upgraded to achieve the SDK, for the application should not 
be upgraded how to deal with it? You can use the downgrade feature. Native can 
be handled by the onException method in interface IWXRenderListener, and if it 
is an active demoulding errCode is a character that is divided by “|”. 
“|” The preceding character is 1 for active demotion, and the Native side 
can jump to the corresponding H5 page. Or otherwise prompted t
 he user’s current environment does not support 
Weex.","type":"references"},{"title":"Event 
Bubble","path":"references/bubble.html","permalink":"https://weex.apache.org/references/bubble.html","text":"Event
 Bubble v0.13+Weex 2.0 implements the W3C standard event bubbling mechanism. 
Usage<template> <div class=\"root\" @click=\"rootClick\" 
bubble=\"true\"> <text style=\"font-size: 
40px;\">{{rootText}}</text> <div 
class=\"outer\" @click=\"parentClick\"> <div> <text 
style=\"font-size: 40px;\">{{parentText}}</text> 
</div> <text class=\"inner\" 
@click=\"click\">{{innerText}}</text> </div> 
</div></template><script> module.exports = { data: 
{ innerText: 'click me', parentText: '', rootText: '' }, methods: 
{ click: function(e) { this.innerText = 'inner bubble' }, 
parentClick: function(e) { this.parentText = '
 parent bubble' }, rootClick: function(e) { this.rootText = 'root 
bubble' } } }</script><style scoped> .inner { 
font-size: 40px; text-align: center; background-color: #7a9b1b; padding: 40px; 
} .outer { font-size: 40px; text-align: center; background-color: 
#9b7a1b; padding: 120px; } .root { font-size: 40px; text-align: 
center; background-color: #7a1b9b; padding: 80px; }</style> try it 
Run the above code, open with the client, click on the middle of the elements, 
you can see the event spread up, followed by the trigger. NoticeOne thing 
should be noticed: For compatibility with previous versions, Weex does not turn 
on event bubbling by default. You need to add bubble = "true" on the 
root element’s properties to turn on the bubbling mechanism. Otherwise, the 
event will not be propagated upwards, keeping the same effect as the previous 
version. stopPropagationIn the event handler function, you can use th
 e e.stopPropagation() method to prevent the event from escalating. Note that 
e.stopPropagation() differs from bubble = "true", which affects only 
the current elements and the propagation of parent elements, without affecting 
the propagation of child elements; the latter is a switching mechanism that is 
added for compatibility, Will be a global shutdown or open the bubble 
mechanism, the two can co-exist, as follows: <template> <div 
class=\"root\" @click=\"rootClick\" bubble=\"true\"> <text 
style=\"font-size: 40px;\">{{rootText}}</text> 
<div class=\"outer\" @click=\"parentClick\"> <div> <text 
style=\"font-size: 40px;\">{{parentText}}</text> 
</div> <text class=\"inner\" 
@click=\"click\">{{innerText}}</text> </div> 
</div></template><script> module.exports = { data: 
{ innerText: 'click me', parentText: '', rootText: '' &
 #125;, methods: { click: function(e) { this.innerText = 'inner 
bubble' }, parentClick: function(e) { this.parentText = 'parent 
bubble' e.stopPropagation() }, rootClick: function(e) { this.rootText 
= 'root bubble' // e.stopPropagation() } } 
}</script><style scoped> .inner { font-size: 40px; 
text-align: center; background-color: #7a9b1b; padding: 40px; } .outer 
{ font-size: 40px; text-align: center; background-color: #9b7a1b; padding: 
120px; } .root { font-size: 40px; text-align: center; 
background-color: #7a1b9b; padding: 80px; }</style> try it Run the 
above code, open with the client, click on the middle of the element, you can 
see the event up to the parent element is terminated, no longer continue to 
spread to the root element.","type":"references"},{"title":"Color 
name","path":"references/color-names.html","permalink":"https://weex.apache.org/references/color-names.html","text":"List
 of t
 he names of colorsBasic color keywords: Color Name Hex rgb black #000000 
silver #C0C0C0 gray #808080 white #FFFFFF maroon #800000 red #FF0000 purple 
#800080 fuchsia #FF00FF green #008000 lime #00FF00 olive #808000 yellow #FFFF00 
navy #000080 blue #0000FF teal #008080 aqua #00FFFF Extended color keywords: 
Color Name Hex rgb aliceblue #F0F8FF antiquewhite #FAEBD7 aqua #00FFFF 
aquamarine #7FFFD4 azure #F0FFFF beige #F5F5DC bisque #FFE4C4 black #000000 
blanchedalmond #FFEBCD blue #0000FF blueviolet #8A2BE2 brown #A52A2A burlywood 
#DEB887 cadetblue #5F9EA0 chartreuse #7FFF00 chocolate #D2691E coral #FF7F50 
cornflowerblue #6495ED cornsilk #FFF8DC crimson #DC143C cyan #00FFFF darkblue 
#00008B darkcyan #008B8B darkgoldenrod #B8860B darkgray #A9A9A9 darkgreen 
#006400 darkgrey #A9A9A9 darkkhaki #BDB76B darkmagenta #8B008B darkolivegreen 
#556B2F darkorange #FF8C00 darkorchid #9932CC darkred #8B0000 darksalmon 
#E9967A darkseagreen #8FBC8F darkslateblue #483D8B darkslategray #2F4F4F 
darkslategre
 y #2F4F4F darkturquoise #00CED1 darkviolet #9400D3 deeppink #FF1493 
deepskyblue #00BFFF dimgray #696969 dimgrey #696969 dodgerblue #1E90FF 
firebrick #B22222 floralwhite #FFFAF0 forestgreen #228B22 fuchsia #FF00FF 
gainsboro #DCDCDC ghostwhite #F8F8FF gold #FFD700 goldenrod #DAA520 gray 
#808080 green #008000 greenyellow #ADFF2F grey #808080 honeydew #F0FFF0 hotpink 
#FF69B4 indianred #CD5C5C indigo #4B0082 ivory #FFFFF0 khaki #F0E68C lavender 
#E6E6FA lavenderblush #FFF0F5 lawngreen #7CFC00 lemonchiffon #FFFACD lightblue 
#ADD8E6 lightcoral #F08080 lightcyan #E0FFFF lightgoldenrodyellow #FAFAD2 
lightgray #D3D3D3 lightgreen #90EE90 lightgrey #D3D3D3 lightpink #FFB6C1 
lightsalmon #FFA07A lightseagreen #20B2AA lightskyblue #87CEFA lightslategray 
#778899 lightslategrey #778899 lightsteelblue #B0C4DE lightyellow #FFFFE0 lime 
#00FF00 limegreen #32CD32 linen #FAF0E6 magenta #FF00FF maroon #800000 
mediumaquamarine #66CDAA mediumblue #0000CD mediumorchid #BA55D3 mediumpurple 
#9370DB mediumseagree
 n #3CB371 mediumslateblue #7B68EE mediumspringgreen #00FA9A mediumturquoise 
#48D1CC mediumvioletred #C71585 midnightblue #191970 mintcream #F5FFFA 
mistyrose #FFE4E1 moccasin #FFE4B5 navajowhite #FFDEAD navy #000080 oldlace 
#FDF5E6 olive #808000 olivedrab #6B8E23 orange #FFA500 orangered #FF4500 orchid 
#DA70D6 palegoldenrod #EEE8AA palegreen #98FB98 paleturquoise #AFEEEE 
palevioletred #DB7093 papayawhip #FFEFD5 peachpuff #FFDAB9 peru #CD853F pink 
#FFC0CB plum #DDA0DD powderblue #B0E0E6 purple #800080 red #FF0000 rosybrown 
#BC8F8F royalblue #4169E1 saddlebrown #8B4513 salmon #FA8072 sandybrown #F4A460 
seagreen #2E8B57 seashell #FFF5EE sienna #A0522D silver #C0C0C0 skyblue #87CEEB 
slateblue #6A5ACD slategray #708090 slategrey #708090 snow #FFFAFA springgreen 
#00FF7F steelblue #4682B4 tan #D2B48C teal #008080 thistle #D8BFD8 tomato 
#FF6347 turquoise #40E0D0 violet #EE82EE wheat #F5DEB3 white #FFFFFF whitesmoke 
#F5F5F5 yellow #FFFF00 yellowgreen #9ACD32","type":"references"},{"title":"Co
 mmon 
Events","path":"references/common-event.html","permalink":"https://weex.apache.org/references/common-event.html","text":"Common
 EventsWeex provide the ability to let events trigger action, like starting a 
JavaScript when a user click on a component. Bellow are the common event 
attributes that can be added to weex components to define event actions. Click 
eventThe onclick attribute fires on a click gesture on the element.Notes: The 
input and switch component does not currently support the click event, please 
use change or input event instead. event object type : click target : The 
target component where the event is triggered timestamp : Timestamp when event 
is triggered Longpress eventIf a longpress event is bound to a component, the 
event will be triggered when user long press on it.Notes: The input and switch 
component does not currently support the click event, please use change or 
input event instead. event object type : longpress target : The target 
component where the eve
 nt is triggered timestamp : Timestamp when event is triggered Appear eventIf a 
appear event is bound to a component inside a scrollable container, the event 
will be triggered when the component comes to be visible. event object type : 
appear target : The target component where the event is triggered timestamp : 
Timestamp when event is triggered direction : The direction in which the 
scroller is scrolling. Could be up or down. Disappear eventIf a disappear event 
is bound to a component inside a scrollable container, the event will be 
triggered when the component scrolls out of viewport and disappears from your 
sight. event object type : disappear target : The target component where the 
event is triggered timestamp : Timestamp when event is triggered direction : 
The direction in which the scroller is scrolling. Could be up or down. Page 
eventWeex provides you with simple management of page status, such as 
viewappear and viewdisappear.The viewappear event will be triggered when page is
  about to show or before any animations are configured for showing. For 
example, when calling push method in navigator module, this event will be 
trigged in new page.The viewdisappear event will be triggeded when page is 
about to dismiss.Different from appear and disappear of component, these two 
events focus on the status of whole page, so they must be bound to the root 
component.In addititon, these events also can be bound to body component which 
is not root actually such as wxc-navpage. event object type : viewappear or 
viewdisappear target : The target component where the event is triggered 
timestamp : Timestamp when event is triggered Example<template> 
<div> <div class=\"box\" @click=\"onclick\" @longpress=\"onlongpress\" 
@appear=\"onappear\" @disappear=\"ondisappear\"></div> 
</div></template><script> const modal = 
weex.requireModule('modal') export default { methods: { onclick 
(event) { console.log('onclick:', event) mod
 al.toast({ message: 'onclick', duration: 0.8 }) }, onlongpress 
(event) { console.log('onlongpress:', event) modal.toast({ message: 
'onlongpress', duration: 0.8 }) }, onappear (event) { 
console.log('onappear:', event) modal.toast({ message: 'onappear', 
duration: 0.8 }) }, ondisappear (event) { 
console.log('ondisappear:', event) modal.toast({ message: 'ondisappear', 
duration: 0.8 }) } } }</script><style scoped> 
.box { border-width: 2px; border-style: solid; border-color: #BBB; width: 
250px; height: 250px; margin-top: 250px; margin-left: 250px; background-color: 
#EEE; }</style>","type":"references"},{"title":"Common 
Style","path":"references/common-style.html","permalink":"https://weex.apache.org/references/common-style.html","text":"Common
 StyleAll of weex tags share some common style rules Box Model Weex box model 
based on the CSS box model, all of weex elements can be con
 sidered as boxes. The term “box model” is used when talking about design 
and layout. The box model is essentially a box that wraps around every HTML 
element. It consists of margins, borders, paddings, and the actual content. you 
can use the definition below in weex box model. width: length type, default 
value 0 height: length type, default value 0 padding: length type, default 
value 0, (space around content, between element content and the element border) 
padding-left: length type, default value 0 padding-right: length type, default 
value 0 padding-top: length type, default value 0 padding-bottom: length type, 
default value 0 margin: length type, default value 0, (space around elements, 
outside the border) margin-left: length type, default value 0 margin-right: 
length type, default value 0 margin-top: length type, default value 0 
margin-bottom: length type, default value 0 border border-style: values solid | 
dashed | dotted, default value solid border-left-style: values solid | 
 dashed | dotted, default value solid border-top-style: values solid | dashed | 
dotted, default value solid border-right-style: values solid | dashed | dotted, 
default value solid border-bottom-style: values solid | dashed | dotted, 
default value solid border-width: length type, non-negative, default value 0 
border-left-width: length type, non-negative, default value 0 border-top-width: 
length type, non-negative, default value 0 border-right-width: length type, 
non-negative, default value 0 border-bottom-width: length type, non-negative, 
default value 0 border-color: color type, default value #000000 
border-left-color: color type, default value #000000 border-top-color: color 
type, default value #000000 border-right-color: color type, default value 
#000000 border-bottom-color: color type, default value #000000 border-radius: 
length type, default value 0, (rounded borders to elements , default value is 0 
meaning right angle ) border-bottom-left-radius: length type, non-negative, 
defau
 lt value 0 border-bottom-right-radius: length type, non-negative, default 
value 0 border-top-left-radius: length type, non-negative, default value 0 
border-top-right-radius: length type, non-negative, default value 0 NotesWeex 
box model uses border-box as the default value of box-sizing, meaning the width 
and height properties includes content, padding and border, but not the margin. 
The rule of border-radius for a specific corner such as border-top-left-radius 
is not currently supported for component <image>in iOS. This only happens 
to iOS, it works fine on Android. Although overflow:hidden is default on 
android, a view will not clip its children according to border-radius unless 
all the following condtions met. This only happens on Android, it works fine on 
iOS. The view type is div, a, cell, refresh or loading. OS version is Android 
4.3 or higher. OS version is not Andorid 7.0 A view does not have 
background-image property nor OS version is Android 5.0 or higher. Example&lt
 ;template> <div> <image src=\"...\" style=\"width: 400; height: 
200; margin-left: 20;\"></image> </div></template> 
FlexboxWeex box style model based on the CSS flexbox, ensures that elements 
behave predictably and the page layout can accommodates to different screen 
sizes and different display devices. Flexbox consists of flex containers and 
flex items. If a weex element can containing other elements, it is a flex 
container. Notice that the old version of flexbox specification has differences 
with the new ones, such as whether or not to support wrapping. This is 
described at w3c’s working drafts, and you should notice the differences 
among them. Also notice that the old version is only supported below the 4.4 
version of android. Flex containerFlexbox is the default and only style model 
in Weex, so you don’t have to add display: flex; in a container. 
flex-direction: values row | column, default value column The flex-direction 
property specifies th
 e direction of the flexible items inside the flex container. Default value is 
column (top-to-bottom). justify-content: values flex-start | flex-end | center 
| space-between, default value flex-start The justify-content property 
horizontally aligns the flexible container’s items when the items do not use 
all available space on the main-axis. Default value is flex-start meaning the 
flex items are positioned at the beginning of the container. flex-end means the 
items are positioned at the end of the container. center means the items are 
positioned at the center of the container. space-between means the items are 
positioned with space between the lines. align-items: values stretch | 
flex-start | center | flex-end, default value stretch The align-items property 
vertically aligns the flexible container’s items when the items do not use 
all available space on the cross-axis. Default value is stretch meaning the 
items are stretched to fit the container. flex-start means the items are po
 sitioned at the top of the container; flex-end means the items are positioned 
at the bottom of the container; center means items are positioned at the center 
of the container (vertically). Flex item flex: number type, default value 0 the 
flex property specifies the length of the flex item, relative to the rest of 
the flex items inside the same container. If all of the flex items set flex: 1, 
they will have equal width or height on direction of flex container’s 
flex-direction. If there are two flex items, with one setting flex: 1, and the 
other setting flex: 2, the first one will take 1/3 container space, and the 
second one will take 2/3 container space. If all of flex items don’t set 
flex, they will be aligned depending on the container’s justify-content 
property. Examplesa list of images with equal scales align at the vertical 
axis: <template> <div style=\"width: 300; height: 100;\"> <image 
src=\"...\" style=\"flex: 1;\"></image> <image src=\"...\" 
 style=\"flex: 1;\"></image> <image src=\"...\" style=\"flex: 
1;\"></image> </div></template> a image with fixed width 
aligns with a stretched text: <template> <div style=\"width: 300; 
height: 100;\"> <image src=\"...\" style=\"width: 100; height: 
100;\"></image> <text style=\"flex: 1;\">...</text> 
</div></template> mixed direction alignment: <template> 
<div style=\"width: 100;\"> <image src=\"...\" style=\"width: 100; 
height: 100;\"></image> <div style=\"flex-direction: row;\"> 
<text style=\"flex: 2; font-size: 32;\">title</text> <text 
style=\"flex: 1; font-size: 16;\">$100</text> </div> 
</div></template> one text align left , the other float right: 
<template><div style=\"flex-direction: row; justify-content: 
space-between;\"> <text>WEEX</text> 
<text>2016-05-08</text></div></template> 
 Positionwe can use properties below to control placement of weex tag position: 
values relative | absolute | fixed | sticky, default value relative relative 
means the item is positioned relative to its normal position. absolute means 
the item is positioned relative to its container. fixed keeps the elements 
position fixed when the page is scrolling. sticky keeps elements positioned 
inside the viewport as “stuck” at the top or “relative” at its original 
place depending on whether does it about to scroll out of the view. top: number 
type, default value 0, upward offset value bottom: number type, default value 
0, downward offset value left: number type, default value 0, leftward offset 
value right: number type, default value 0, rightward offset value 
Examples<template> <div style=\"flex-direction: column;\"> <div 
style=\"height: 3000;\"> <image src=\"...\" style=\"top: 50px; left: 
50px;\"></image> </div> <div style=\"height: 3000;\"> &lt
 ;image src=\"...\" style=\"position: sticky;\"></image> </div> 
<div style=\"height: 3000;\"> <image src=\"...\" style=\"position: 
absolute; top: 50px; left: 50px;\"></image> </div> 
</div></template> transformThe CSS transform property lets you 
modify the coordinate space of the CSS visual formatting model. Using it, 
elements can be translated, rotated and scaled. Currently supported format: 
translate( [, ]?) translateX( ) translateY( ) scale( ) scaleX( ) scaleY( ) 
rotate( ) transform-origin: number/percentage/keyword(top/left/right/bottom) 
Example<template> <div class=\"wrapper\"> <div 
class=\"transform\"> <text class=\"title\">Transformed 
element</text> </div> </div></template><style> 
.transform { align-items: center; transform: translate(150px,200px) 
rotate(20deg); transform-origin: 0 -250px; border-color:red; border-width:2px; 
} .title {font-size: 48px;}&lt
 ;/style> Pseudo class v0.9.5+Weex support four pseudo-classes: active, 
focus, disabled, enabled All components support active, but only the input 
component and the textarea component support focus, enabled, diabled. Rule the 
high priority override low priority when rules take effect at the same time 
such as: “input:active:enabled” will override “input:active” the 
interconnection rule as follow Example<template> <div 
class=\"wrapper\"> <image :src=\"logoUrl\" 
class=\"logo\"></image> </div></template><style 
scoped> .wrapper { align-items: center; margin-top: 120px; } 
.title { font-size: 48px; } .logo { width: 360px; height: 82px; 
background-color: red; } .logo:active { width: 180px; height: 82px; 
background-color: green; }</style><script> export default 
{ props: { logoUrl: { default: 
'https://alibaba.github.io/weex/img/weex_logo_b...@3x.png' }, target: 
{ de
 fault: 'World' } }, methods: { update (e) { this.target = 
'Weex'; } } };</script> Try it linear-gradient v0.10+Weex 
support linear-gradient background, You can see W3C description of the 
gradient. Supported componentsAll components in Weex support gradients UsageYou 
can use linear gradient by background-image property. background-image: 
linear-gradient(to top,#a80077,#66ff00); radial-gradient is not currently 
supported, do not use it. Weex currently supports two color gradients. The 
direction of the gradient is as follows: to rightFrom left to right to leftFrom 
right to left to bottomFrom top to bottom to topFrom bottom to top to bottom 
rightFrom the upper left corner to the lower right corner to top leftFrom the 
lower right corner to the upper left corner Note background-image and 
background-color are set at the same time, background-image precedes 
background-color. Do not use shorthand property such as background. 
Example<template> &l
 t;scroller style=\"background-color: #3a3a3a\"> <div 
class=\"container1\" style=\"background-image:linear-gradient(to 
right,#a80077,#66ff00);\"> <text class=\"direction\">to 
right</text> </div> <div class=\"container1\" 
style=\"background-image:linear-gradient(to left,#a80077,#66ff00);\"> 
<text class=\"direction\">to left</text> </div> <div 
class=\"container1\" style=\"background-image:linear-gradient(to 
bottom,#a80077,#66ff00);\"> <text class=\"direction\">to 
bottom</text> </div> <div class=\"container1\" 
style=\"background-image:linear-gradient(to top,#a80077,#66ff00);\"> 
<text class=\"direction\">to top</text> </div> <div 
style=\"flex-direction: row;align-items: center;justify-content: center\"> 
<div class=\"container2\" style=\"background-image:linear-gradient(to bottom 
right,#a80077,#66ff00);\"> <text class=\"direction\">to bottom 
right</text> </div> 
 <div class=\"container2\" style=\"background-image:linear-gradient(to top 
left,#a80077,#66ff00);\"> <text class=\"direction\">to top 
left</text> </div> </div> 
</scroller></template><style> .container1 { margin: 
10px; width: 730px; height: 200px; align-items: center; justify-content: 
center; border: solid; border-radius: 10px; } .container2 { margin: 
10px; width: 300px; height: 300px; align-items: center; justify-content: 
center; border: solid; border-radius: 10px; } .direction { font-size: 
40px; color: white; }</style> box-shadow v0.11+Weex supports 
box-shadow in iOS: inset,offset-x,offset-y, blur-radius,color Note box-shadow 
takes effect in iOS Example<template> <div class=\"wrapper\"> 
<div style=\"width:400px; height:60px;background-color: #FFE4C4; 
box-shadow:20px 10px rgb(255, 69, 0);\"> <text class=\"title\" 
style=\"text-align: center\">Hello {{target}&#12
 5;</text> </div> <div style=\"margin-top: 80px;width:400px; 
height:60px;background-color: #FFE4C4; box-shadow: 20px 10px 5px rgba(255, 69, 
0, 0.8);\"> <text class=\"title\" style=\"text-align: center\">Hello 
{{target}}</text> </div> <div 
style=\"margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; 
box-shadow:inset 20px 10px 5px rgba(255, 69, 0, 0.8);\"> <text 
class=\"title\" style=\"text-align: center\">Hello 
{{target}}</text> </div> <div 
style=\"margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; 
box-shadow:inset 20px 10px 5px rgb(255, 69, 0);\"> <text class=\"title\" 
style=\"text-align: center\">Hello 
{{target}}</text> </div> <div 
style=\"margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; 
box-shadow:20px 10px 5px black;\"> <text class=\"title\" 
style=\"text-align: center\">Hell
 o {{target}}</text> </div> <div 
style=\"margin-top: 80px;width:400px; height:60px;background-color: #FFE4C4; 
box-shadow:20px 10px 5px #008B00;\"> <text class=\"title\" 
style=\"text-align: center\">Hello 
{{target}}</text> </div> 
</div></template><style scoped> .wrapper {align-items: 
center; margin-top: 120px;} .title {font-size: 
48px;}</style><script> module.exports = { data: function 
() { return { logoUrl: 
'https://alibaba.github.io/weex/img/weex_logo_b...@3x.png', target: 'World' 
}; } };</script> Other Common Style opacity 
background-color Type of Style Value length type number type color type (The 
list of color keywords.) enumerated type Simple StepThese up-to-down steps may 
help you to plan the whole style of weex pages. overall style: divide the whole 
page to different parts flex alignment: align boxes in every part of 
 page position box: place box, set offset element specific style: set styles 
for certain element if 
needed","type":"references"},{"title":"downgrade","path":"references/downgrade.html","permalink":"https://weex.apache.org/references/downgrade.html","text":"downgradeWeex
 2.0 downgrade change to module,please refer to 
downgrade","type":"references"},{"title":"Gesture","path":"references/gesture.html","permalink":"https://weex.apache.org/references/gesture.html","text":"Gesture
 Experiment Feature Weex encapsulates native touch events to provide a gesture 
system. Using gesture is similar to use event in Weex. Just set on attributes 
on a node to listen to gesture. TypeFor now, there are four types of gestures: 
Touch. Touch gesture is fired when a touch point is placed, moved or removed 
from the touch surface. Touch gesture is accuracy as it will report every 
trivial event. As a result, listening to touch gesture may be slow, a great 
deal of events needs to be processed even a small move
  happened. There are three types of Touch gesture: touchstart will be fired 
when a touch point is placed on the touch surface. touchmove will be fired when 
a touch point is moved along the touch surface. touchend will be fired when a 
touch point is removed from the touch surface. Pan. Pan gesture also report 
motion of touch point on the touch surface, which is similar to touch gesture. 
But Pan gesture is sampled and faster than the touch event. As consequence, it 
is less accuracy than touch gesture. There are also three types of Pan gesture, 
and the meaning of these types is very close to types of Touch. panstart 
panmove panend Horizontal/Vertical Pan v0.10+ . Mainly used for cell swipe 
gestures before conflict resolving system is completed. start/move/end state of 
the gesture will be passed by state property. Note: These gestures are in 
conflict with click event on Android currently. horizontalpan verticalpan 
Swipe. Swipe is fired when user swipe a touch point on the screen. A seri
 al of motion will only trigger one Swipe gesture. LongPress. LongPress is 
fired when a touch point is held for 500 ms or more. The Touch gesture and Pan 
is very close to each other, with following features hold: Touch. Not sampled, 
accuracy, but slow. Pan. Sampled, fast, less accuracy. Users may choose their 
gesture according to their situation. PropertiesThe following properties can be 
used in gesture callback: direction. Only exists for Swipe gesture. Indicate 
the direcion of the swipe, choose from up, left, bottom, right. changedTouches. 
An array of motion for every touch pointer that has contribute to the current 
gesture. changedToucheschangedTouches is an array, with the following 
properties in its children: identifier. A unique identifier for a touch 
pointer. pageX. The X coordinate of the touch pointer relative to the left edge 
of the document. pageY. The Y coordinate of the touch pointer relative to the 
top of the document. screenX. The X coordinate of the touch point relati
 ve to the left edge of the screen. screenY. The Y coordinate of the touch 
point relative to the top edge of the screen. ConstrainCurrently, Weex Android 
do not support listening to gesture on scroller, list and webview, as it would 
lead a large amount of event conflicting.","type":"references"},{"title":"HTML5 
APIs","path":"references/html5-apis.html","permalink":"https://weex.apache.org/references/html5-apis.html","text":"HTML5
 APIsVue APIs","type":"references"},{"title":"iOS 
APIs","path":"references/ios-apis.html","permalink":"https://weex.apache.org/references/ios-apis.html","text":"iOS
 APIsHandler(like Android Adapter) WXImgLoaderDefaultImpl Image load handler. 
Weex need to implement this interface to download the picture. The interface is 
defined as follows: @protocol WXImgLoaderProtocol <WXModuleProtocol>/** * 
@abstract Creates a image download handler with a given URL * * @param imageUrl 
The URL of the image to download * * @param imageFrame The frame of the image 
you w
 ant to set * * @param options : The options to be used for this download * * 
@param completedBlock : A block called once the download is completed. * image 
: the image which has been download to local. * error : the error which has 
happened in download. * finished : a Boolean value indicating whether download 
action has finished. */- 
(id<WXImageOperationProtocol>)downloadImageWithURL:(NSString *)url 
imageFrame:(CGRect)imageFrame userInfo:(NSDictionary *)options 
completed:(void(^)(UIImage *image, NSError *error, BOOL 
finished))completedBlock;@end Native interacts with JavaScript Custom events 
Used for a custom control for event notifications, such as custom click events, 
response drop events, and so on. This is a method in the component base class 
that can be used directly. /** * @abstract Fire an event to the component and 
tell Javascript which value has been changed. * @param eventName * @param 
params * @param domChanges **/- (void)fireEvent:(NSString *)eventName 
params:(NSDi
 ctionary *)params domChanges:(NSDictionary *)domChanges Event callback Used 
for Module callback. There are two types of callback: WXModuleCallback: For 
performance reasons, the callback can only callback js once, and then will be 
released. WXModuleKeepAliveCallback: This callback can be set to multiple 
callbacks, multiple callbacks of the scene such as continually listen scrolls 
event and return to js. @implementation WXEchoModule@synthesize 
weexInstance;WX_EXPORT_METHOD(@selector(echo:))- (void)echo:(NSString *)param 
callback:(WXModuleKeepAliveCallback)callback{ callback(param,ture);} 
Set size of the Weex containerYou can use the setFrame(CGRect) method to change 
the size of the Weex container. DowngradeWeex in the development stage will add 
some new features and new methods, but these new features and functions must be 
upgraded to achieve the SDK, for the application should not be upgraded how to 
deal with it? You can use the downgrade feature. Native can be handled by t
 he onFailed method in interface WXSDKInstance, and if it is an active 
demoulding error domain is TemplateErrorType, and the Native side can jump to 
the corresponding H5 page. Or otherwise prompted the user’s current 
environment does not support Weex.","type":"references"},{"title":"JS Framework 
APIs","path":"references/jsfm-apis.html","permalink":"https://weex.apache.org/references/jsfm-apis.html","text":"JS
 Framework APIsBroadcastChannel v0.9+BroadcastChannel API is the solution for 
inter-instance communication. Reference BroadcastChannel specification. 
MessageEvent specification API postMessage(message): Sends the given message to 
other BroadcastChannel objects set up for this channel. close: Closes the 
BroadcastChannel object, opening it up to garbage collection. onmessage: Event 
handler, the event will be triggered when the instance receive a message. 
Usageconst Stack = new BroadcastChannel('Avengers')Stack.onmessage = function 
(event) { console.log(event.data) // in this
  case, it's \"Hulk Smash !!!\"}// in another instanceconst Hulk = new 
BroadcastChannel('Avengers')Hulk.postMessage(\"Hulk Smash !!!\") Run the code 
above, Stack can receive the message from Hulk. NoticeOne thing should be 
noticed: The message object is not deep cloned. See the demo below: const a = 
new BroadcastChannel('app')const b = new BroadcastChannel('app')const message = 
{ lists: ['A', 'B']}a.onmessage = function (event) { // in this 
case, event.data is a reference of message console.assert(event.data === 
message)}b.postMessage(message) In this case, event.data is strict equal 
to message. Compared to the deep clone, this behavior improves efficiency and 
reduces memory cost. However, developers are not recommended to cache or modify 
the event object when they are using it (All type of event handlers should have 
this restriction).","type":"references"},{"title":"Native DOM 
APIs","path":"references/native-dom-api.html","permalink":"https://weex.apache.org
 /references/native-dom-api.html","text":"Native DOM APIsWeex in the JS engine, 
for each page provides a set of Native DOM APIs. This interface is very close 
to the HTML DOM APIs. Using this interface we can control native rendering 
logic via JavaScript. And Weex upper layer of Vue 2.0 is based on this 
interface to adapt. In most cases, the JS framework will encapsulate native DOM 
APIs. That way, the developer does not need to work directly on the Native DOM. 
Document class: full page document. Node class: the base class of nodes. 
Element class: element node, inherited from Node, single view unit. Comment 
class: comment node, inherited from Node, no practical meaning, usually used as 
placeholders. Each Weex page has a weex.document object, which is an instance 
of the Document class and is the starting point for all the following interface 
calls. Let’s take a look at their usage in detail: Document classEach 
Document instance will automatically have a documentElement property when i
 t is created. This attribute represents the document node. The document node 
can have a body, which is the main node of the document. Note: The document 
node body only accepts <div>, <list>, or <scroller> three 
types of element nodes. Constructornew Document(id: string, url: string?) 
Member methodcreateElement(tagName: string, props: Object?): Element Creates an 
Element instance of a specific type tagName, which is an element node. Props 
can contain attr objects and style objects. Such as createBody ('div', 
{style: {backgroundColor: '#ffffff'}}). createComment(text: string): 
Comment Create an instance of ·Comment, which is a comment node and set a text 
description. createBody(tagName: string, props: Object?): Element Create a 
document body node and automatically mount it under documentElement. 
fireEvent(el: Element, type: string, e: Object?, domChanges: Object?)Triggers a 
particular type of event. When the event modifies the DOM’s properties or s
 tyles during the generation process, the fourth argument is used to describe 
the changes, and the parameter format is the same as the format of the 
createElement method above. destroy() Destroy the current document. Once the 
document is destroyed, it will no longer work. Read-only member variablesid: 
string Each Document instance has a unique id. This is also the only id that 
each Weex page has. URL: string? If the current Weex page has a JS bundle URL, 
the URL will be returned here. body: Element The main body of the document, the 
concept similar to the HTML DOM document.body. documentElement: Element 
Document node, the concept similar to the HTML DOM document.documentElement. 
The relationship between body and documentElement is: documentElement is the 
parent of the body. getRef(id): Node Get the node based on the node id. Node 
ClassConstructornew Node() Member methoddestroy() Read-only member variables or 
methodsref: string Each Node instance has its own unique ref value in the en
 tire `Document instance. nextSibling: Node? previousSibling: Node? parentNode: 
Node? The three interfaces are consistent with the definition of HTML DOM. 
children: Node[] The node has an array of all child nodes. pureChildren: Node[] 
The node has an array of all the child elements. The difference between it and 
children is that pureChildren contains only the Element instance and not the 
Comment instance. Element class, inherited from NodeConstructornew 
Element(type: string, props: Object?) Creates an element node of a particular 
type type, and the props parameter can contain an attr object or a style 
object. DOM tree operationappendChild(node: Node)insertBefore(node: Node, 
before: Node?) The two interfaces are similar to HTML DOM. insertAfter(node: 
Node, after: Node?) Insert a new node before a child node. removeChild(node: 
Node, preserved: boolean?) Delete the child node node. Parameters preserved 
whether it is immediately removed from memory or temporarily retained. clear() 
Clear 
 all child nodes. The DOM property itself operatessetAttr(key: string, value: 
string, silent: boolean?) setStyle(key: string, value: string, silent: 
boolean?) In the above two interfaces, when silent is true, the node only 
updates itself, does not pass the command to the client render layer. This 
parameter is used to handle user events that have changed the node-related 
properties at the time of occurrence, and will not send commands repeatedly to 
the client after the Native DOM has changed. addEvent(type: string, handler: 
Function) removeEvent(type: string) fireEvent(type: string, e: any) Bind 
events, unbind events, trigger events. Component method for a specific 
component typeSpecial: Different component types can have their own unique 
methods, such as <web> components support refresh method. You can see the 
description of each component. In this case, we will generate a specific 
component type of class, such as WebElement, which inherited from Element. Such 
as: WebElement in
 herited from ElementIndicates that a webview is embedded in the Wex page 
Refresh (): Refreshes the current webview Read-only member variables or 
methodsref, nextSibling, previousSibling, parentNode Inherited from Node. 
nodeType: number The number is always 1. type: string Consistent with the type 
in the constructor. attr: Object The key pair of all the characteristics of the 
current node. It is recommended to use the setAttr () method to modify, rather 
than directly modify the object here. style: Object The value of all the keys 
of the current node. It is recommended to modify the setStyle () method, rather 
than directly modify the object here. event: Object All events of the current 
node are bound. Each event type corresponds to an event handler method. It is 
recommended to use the addEvent () / removeEvent () method to modify, rather 
than directly modify the object here. toJSON(): Object Returns a JSON object 
that describes the element’s node, such as: {ref: string, type: string
 , attr: Object, style: Object, event: Array (string), children: Array}. 
Comment class, inherited from NodeConstructornew Comment(value: string) 
Read-only member variables or methodsref, nextSibling, previousSibling, 
parentNode Inherited from Node. nodeType: number The number is always 8. type: 
string The type is always 'comment' value: string Consistent with the 
value in the constructor. toJSON(): Object Returns a JSON object describing the 
annotation node. For example: <! - value 
->.","type":"references"},{"title":"Path","path":"references/path.html","permalink":"https://weex.apache.org/references/path.html","text":"Path0.9
 This article will cover uri (url) usage in Weex. Including using 
image/typeface resources, deal with relative uri and how to access local and 
packaged asset files. Schemes LocalWeex SDK provide local scheme to access 
resources packaged with application, and of cource, it’s not working in the 
HTML5 runtime.Currently, developers can use this scheme
  with image and text’s font file location. In iOS, it’s always locate file 
in ‘bundle resources’. For example, a image component with 
local:///app_icon will load image file named ‘app_icon’ in bundle resouce, 
and font file work in the same way. In Android, image component will load from 
‘drawable’ resource folder like ‘res/drawable-xxx’. But load font file 
is different, android framework can not load font file from ‘res’, so SDK 
will load it from asserts folder. HTTP/HTTPSIt’s working in the same way as 
in web, Weex support these at very beginning. FileUse file scheme to access 
local disk file. This scheme has its limitations: You would not hard coded a 
file url in source page. Because not matter it’s running in different 
platform(iOS, Android) or not, the content will be totally different in another 
device, which is depend to the specific device.So one possible case is getting 
the file url in runtime dynamically, which you can use it to diaplay a local d
 isk image, or maybe upload it later. Relative URILike we do in HTML, weex 
process ‘relative URI’ in the same way. The relative URI, which start with 
/,.,..,//, will resolve by the bunle url.Means URL start with / will resolve to 
the root folder as bundle js file, . and .. will resolve to current and parent 
folder, and // will resolve to same scheme bundle js have. URI AdapterAll the 
above is the default implementation, developers can extend or override these 
their own by providing a ‘URI Adapter’. Same as the other adapters, Custom 
adapter should be set before Weex SDK is 
initializing.","type":"references"},{"title":"Platform Differences Between Weex 
and 
Web","path":"references/platfrom-difference.html","permalink":"https://weex.apache.org/references/platfrom-difference.html","text":"Platform
 Differences Between Weex and WebWork in 
progresss.","type":"references"},{"title":"Text 
Style","path":"references/text-style.html","permalink":"https://weex.apache.org/references/text-s
 tyle.html","text":"Text StyleText alike components share some common style 
rules. The text alike components currently includes text and input. Properties 
color: <colors> this property set the foreground color of an 
component’s text content. font-size: <length> this property specifies 
the size of the font. font-style: <enum> normal | italic. This property 
lets you select italic or normal faces within a font-family. Default value is 
normal. font-weightv0.9+: values: normal, bold, 100, 200, 300, 400, 500, 600, 
700, 800, 900 normal is equal to 400, bold equel to 700 default value: normal 
apply to: <text>, <input> ios support showing 9 kind of 
font-weight. android support showing 2 kind of font-weight:400,700, other value 
will map to 400 or 700 Some standard values like lighter, bolder, number unit 
are not supported. The effect not apply to all elements, just <text> and 
<input>. In another way, it’s not inherited. text-decoration: 
<enum&gt
 ; none | underline | line-through. This property is used to set the text 
formatting to underline or line-through. The default value is none. text-align: 
<enum> left | center | right. This property describes how inline content 
like text is aligned in its parent component. The default value is left. 
font-family:<string> this property set the font-family of the text. This 
property doesn’t guarantee the given font will always be set to the text. If 
the specified font cannot be found at the device, a typeface fallback will 
occur and the default typeface will be load. The fallback mechanism may vary in 
different devices. text-overflow:<string> clip | ellipsis. This property 
determines how overflowed content that is not displayed is signaled to users. 
It c

<TRUNCATED>

Reply via email to