* [doc] update input components document & bubble document
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/bf874113 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/bf874113 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/bf874113 Branch: refs/heads/0.16-dev Commit: bf874113e47186bf11903db829d1a77765ad18c3 Parents: 3b9b5a5 Author: tancy <ron...@gmail.com> Authored: Wed Jul 19 15:12:22 2017 +0800 Committer: tancy <ron...@gmail.com> Committed: Wed Jul 19 15:12:22 2017 +0800 ---------------------------------------------------------------------- doc/source/_posts/coreml.md | 79 +++++++++++++++++++++++ doc/source/_posts/hello_world.md | 3 +- doc/source/_posts/test.md | 14 ++++ doc/source/cn/references/bubble.md | 4 +- doc/source/cn/references/components/input.md | 34 +++++----- doc/source/cn/v-0.10/references/bubble.md | 6 +- doc/source/references/bubble.md | 4 +- doc/source/references/components/input.md | 34 +++++----- doc/source/v-0.10/references/bubble.md | 8 +-- 9 files changed, 142 insertions(+), 44 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/_posts/coreml.md ---------------------------------------------------------------------- diff --git a/doc/source/_posts/coreml.md b/doc/source/_posts/coreml.md new file mode 100644 index 0000000..c628fb3 --- /dev/null +++ b/doc/source/_posts/coreml.md @@ -0,0 +1,79 @@ +title: Weex â¤ï¸ iOS 11 ç³»åä¹ä¸ï¼Core ML åæ¢ +type: blog +date: 2017-06-21 15:46:44 + +--- + +## èæ¯ + +WWDC 2017 æä¸ä¸ªé常æç¡®çä¿¡å·ï¼**端ä¸æºå¨å¦ä¹ å°ä¼æ¯æªæ¥è¹æçä¸ä¸ªéè¦ååç¹ï¼åæ¶å¼åè ç使ç¨é¨æ§å¨ä¸æéä½**ã + +Core ML æ¯ä»å¹´ WWDC ä¸è¹æåå¸çæºå¨å¦ä¹ æ¡æ¶ãå®å 许å¼åè å¨èªå·±å¼åç app ä¸ä½¿ç¨æºå¨å¦ä¹ ï¼åæ¶ä¸éè¦æ¶éç¨æ·æ°æ®ã æäº Core MLï¼ä½ å¯ä»¥å°èªå·±è®ç»å¾å°ç模åï¼åå©è¹ææä¾ç转æ¢å·¥å ·ï¼è½¬åæ Core ML ç±»åç模åæ件ï¼ä½ å¯ä»¥é常轻æ¾å°ç´æ¥å®ç°æ¨¡åå app æ°æ®çäºéã + +WWDC ä¸å±ç¤ºäºä¸å¼ ç®åçæ¶æå¾ï¼ + +![å±å¹å¿«ç § 2017-06-20 ä¸å8.50.21](https://gw.alicdn.com/tfs/TB1YT5dRVXXXXc1XFXXXXXXXXXX-498-392.png) + +æåºå±ç Accelerate å MPSï¼å ¶å®æ¯è¹æå»å¹´æ¨åºçæ¥å£ï¼åè å¯ä»¥ç´æ¥è°ç¨ CPUï¼åè åç´æ¥è°ç¨ GPUã Core ML ä¼èªè¡å³å®å°åºä½¿ç¨ CPU è¿æ¯ GPU æ¥è¿è¡è¿ç®ï¼å¯ä»¥æ大ç¨åº¦å°å©ç¨ç¡¬ä»¶èµæºæ¥å¤ç模åæ°æ®ã + +è Core ML å¾ä¸ä¸å±åæ¯åºç¨å±ãVision 主è¦è´è´£å¾åç¸å ³ç人工æºè½å¤çï¼å¦äººè¸è¯å«ãé¢é¨è¿½è¸ªãæåè¯å«ççï¼NLP åæä¾è¯ä¹åæç¸å ³ APIãè¿é¨åå 容å¨ä»¥åçæ¬ç SDK ä¸ä¹åå¨ï¼è¿æ¬¡è¢«éæå°äºæ°æ¡æ¶å½ä¸ã好å¤å¨äºï¼å¼åè æ¥æäºæ´å¤§çèªç±åº¦ãå¨ä»¥åï¼å¼åè ç app è°ç¨è¿äºé«çº§æ¥å£ï¼å¯¹åºå±çå®ç°ç»èçææ§å度é常å°ãç°å¨ï¼ä½ å¯ä»¥éè¿èªå®ä¹åºå±æ使ç¨çæºå¨å¦ä¹ 模åï¼ä»èå®ç°æ´ä¸ªæ§åçéæ±ã + +## Weex-ML + +Weex 交äºè§è§è½åå°ç»ä¸æå°ï¼**Weex æ大çç¹å«ä¹å¤å¨äºå ¶ native çè½åï¼ æ们è¦æ大åå©ç¨ native çç¹æ§ï¼ èä¸æ¯å»æ¨¡ä»¿å®**ã + +ä½ä¸ºæ¬æ¬¡ iOS 11 çä¸ä¸ªéè¦ native è½åï¼æä¹ç¬¬ä¸æ¶é´å°è¯å° Core ML éä¼ å°äº Weex ä¸ãææ代ç å Demo é½å·²å¼æºå° [Github](https://github.com/cxfeng1/Weex-ML)ï¼åç»ä¹ä¼å°æºå¨å¦ä¹ ç¸å ³çWeex 模åç»ä¸æ¾å° Weex Market ä¸ã + +å¾çäº Core ML API çç®æ´ï¼å¨ Weex ä¸ä½¿ç¨ Core ML ç¸å ³è½ååå¾é常ç®å: + +```javascript +let imageRecognition = weex.requireModule('imageRecognition') +imageRecognition.predictWithImage(this.$refs.image.ref, (results)=>{ + this.results = results.slice(0,5); +}) +``` + +éè¿è°ç¨éä¼ ç module `imageRecognition` , å¹¶ä¼ å ¥ image ç»ä»¶ç ref ä½ä¸ºåæ°ï¼å°±å¯ä»¥å®ç°å¾çè¯å«çåè½ï¼æåæååºè¯å«ç»æä¸ confidence æé«ç 5 个ç»æã + +## Demo + +### imageRecognition + +![](https://gw.alicdn.com/tfs/TB1AmqgRVXXXXcmXFXXXXXXXXXX-240-427.gif) + +ä½¿ç¨ [Inceptionv3](https://github.com/fchollet/keras/blob/0bb4e0fad5b4bb3743c8a7d03c260b62a35e7045/keras/applications/inception_v3.py) ä½ä¸ºæ¨¡åï¼è½å¤é«æè¯å«ï¼ 该模åå·²ç»å¨ [keras](https://github.com/fchollet/keras) ä¸è¢«è®ç»å¥½å¹¶éè¿è¹ææä¾çå·¥å ·è½¬æ¢æ **mlmodel** æä»¶ï¼ åªéææ½çæ¹å¼å°±å¯ä»¥éæå° iOS å¼åç¯å¢ä¸ï¼ ä¸è¿° demo è¾åºäºå¯¹ä¸å¼ å¾çåç±»æ大å¯è½ç5个é¢æµç»æï¼ å¯¹äº Weex æ¥è¯´ï¼å è¡ä»£ç å°±è½æå®ã + + + +### digitDetect + +![](https://gw.alicdn.com/tfs/TB1nZ8_RVXXXXczXVXXXXXXXXXX-240-427.gif) + +ä¸è¿° demo é¦å ä½¿ç¨ [weex-gcanvas](http://market.dotwe.org/ext/list.htm#6) æ件åäºä¸ä¸ªç®åçç»å¶æ¿ï¼ç¶åä½¿ç¨ MNIST model å®æäºå¯¹æåæ°åçè¯å«ã + +### faceDetect + +![](https://gw.alicdn.com/tfs/TB1lN0_RVXXXXa_XVXXXXXXXXXX-240-427.gif) + +è¿ä¸ª demo 没æå è½½ä»»ä½ modelï¼ä½¿ç¨äº iOS 11 å ç½®ç Vision Frameworkï¼é¡¾åæä¹ï¼Vision å¯ä»¥è®©å¼åè è¿è¡è®¡ç®æºè§è§ç¸å ³çä»»å¡ï¼å®ç¸å½äº Core ML ç High-Level Solutionï¼ å®å¯ä»¥åå¾å¤äºæ : + +- è¸é¨è¯å«ï¼ä¼è¿åä¸ä¸ªç©å½¢æ°ç»æ¥è¡¨ç¤ºæ¯ä¸ä¸ªè¸é¨ +- è¸é¨æ´ç²¾ç»è¯å«ï¼æ¯å¦ç¼çåé¼»åçå ·ä½ä½ç½®ã头é¨çå½¢ç¶çï¼ä¸è¿° demo å°±æ¯æ¿å°è¿äºä¿¡æ¯ä»¥åä½¿ç¨ gcanvas ç»å¶åºäºé¢é¨ç²¾ç»è½®å» +- å¾çä¸çç©å½¢æ¢æµ +- å¾çä¸çæåæ¢æµ +- äºç»´ç /æ¡å½¢ç æ¢æµ +- è§é¢ä¸è·è¸ªç§»å¨çç©ä½ + +## æ»ç» + +è¿æ¬¡ Core ML çæ¨åºï¼åæ¶å¾çäºè¹æ对软硬件çå ¨é¢ææ§ï¼ä½¿å¾ä»ç³»ç»çº§å°ç¬¬ä¸æ¹å¼åè ï¼é½å ·å¤äºå¨ç«¯ä¸å°±å¯ä»¥è¿è¡æºå¨å¦ä¹ 模åå¤ççè½åãææ代ç å Demo é½å·²ä¸ä¼ å° [Github](https://github.com/cxfeng1/Weex-ML)ï¼æ¬¢è¿è´¡ç®å交æµã + +å½ç¶å¨å®é ç 究è¿ç¨ä¸ï¼ä¹åç°äº Core ML çä¸äºéå¶ï¼ + +- æ æ³å¨ç«¯ä¸è¿è¡æ¨¡åçè®ç»ï¼ææ模åå¿ é¡»æåè®ç»å¥½å转æ¢æ Core ML çæ ¼å¼ +- æ æ³å¨æä¸è½½åæ´æ°æ¨¡åï¼å¯¹äºéè¦ç»å¸¸éæ°è®ç»ç模åä¸å¤ªå好 +- ç®åçåªæ¯æçç£å¦ä¹ ç模åï¼ä¸æ¯æéçç£å¦ä¹ ã + +Weex æªæ¥å¨æä¾æ´å¤åè½éä¼ çåæ¶ï¼ä¹ä¼ç»§ç»æ¢ç´¢æ´æ·±å±æ¬¡çç»åã + +æåï¼æ¬ææ¯ Weex å iOS 11 ç»åç³»åç第ä¸ç¯æç« ï¼åç»å°ä¼ææ´å¤æææçiOS 11 feature (å¦ ARKitã drag & drop ç) å大家ä¸èµ·æ¢è®¨ã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/_posts/hello_world.md ---------------------------------------------------------------------- diff --git a/doc/source/_posts/hello_world.md b/doc/source/_posts/hello_world.md index 07f4223..803ef70 100644 --- a/doc/source/_posts/hello_world.md +++ b/doc/source/_posts/hello_world.md @@ -1,6 +1,7 @@ title: Hello World type: blog -order: 1 + --- # Hello world + http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/_posts/test.md ---------------------------------------------------------------------- diff --git a/doc/source/_posts/test.md b/doc/source/_posts/test.md new file mode 100644 index 0000000..afaa8ec --- /dev/null +++ b/doc/source/_posts/test.md @@ -0,0 +1,14 @@ +title: test +type: blog + +--- + + +# test + +asdfadfasdfasdfadfadsf +asdfasdfadsf +adsfadsfadsf + +## sdfasdfasdf +sdfsdfsdf \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/cn/references/bubble.md ---------------------------------------------------------------------- diff --git a/doc/source/cn/references/bubble.md b/doc/source/cn/references/bubble.md index 4b63cad..6f8f0ed 100644 --- a/doc/source/cn/references/bubble.md +++ b/doc/source/cn/references/bubble.md @@ -11,7 +11,7 @@ Weex 2.0 å®ç°äº W3C æ åçäºä»¶å泡æºå¶ã ### ä½¿ç¨ -```javascript +```html <template> <div class="root" @click="rootClick" bubble="true"> <text style="font-size: 40px;">{{rootText}}</text> @@ -81,7 +81,7 @@ Weex 2.0 å®ç°äº W3C æ åçäºä»¶å泡æºå¶ã å¨äºä»¶å¤çå½æ°ä¸ï¼å¯ä»¥ä½¿ç¨ `e.stopPropagation()` æ¹æ³ï¼æ¥é»æ¢æ¬æ¬¡äºä»¶åä¸çä¼ éè¿ç¨ã注æï¼`e.stopPropagation()` ä¸ `bubble="true"` ä¸åï¼åè åªä¼å½±åå½åå ç´ ä»¥åç¶å ç´ çä¼ æï¼ä¸ä¼å½±ååå ç´ çä¼ æï¼åè æ¯ä¸ºäºçæ¬å ¼å®¹èå¢å çå¼å ³æºå¶ï¼ä¼å ¨å±å ³éæè å¼å¯å泡æºå¶ï¼ä¸¤è å¯ä»¥å ±ååå¨ä½¿ç¨ï¼å¦ä¸ï¼ -```javascript +```html <template> <div class="root" @click="rootClick" bubble="true"> <text style="font-size: 40px;">{{rootText}}</text> http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/cn/references/components/input.md ---------------------------------------------------------------------- diff --git a/doc/source/cn/references/components/input.md b/doc/source/cn/references/components/input.md index a0aecf8..3cf83fd 100644 --- a/doc/source/cn/references/components/input.md +++ b/doc/source/cn/references/components/input.md @@ -135,13 +135,15 @@ Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥å建æ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç» <text style="font-size: 40px">oninput: {{txtInput}}</text> <text style="font-size: 40px">onchange: {{txtChange}}</text> <text style="font-size: 40px">onreturntype: {{txtReturnType}}</text> + <text style="font-size: 40px">selection: {{txtSelection}}</text> + </div> <scroller> <div> <div style="background-color: #286090"> <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = text</text> </div> - <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput" @focus="onfocus" @blur="onblur"/> + <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput"/> </div> <div> @@ -181,6 +183,13 @@ Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥å建æ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç» <div> <div style="background-color: #286090"> + <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = number</text> + </div> + <input type="number" placeholder="Input number" class="input" @change="onchange" @input="oninput"/> + </div> + + <div> + <div style="background-color: #286090"> <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = date</text> </div> <input type="date" placeholder="Input Date" class="input" @change="onchange" @input="oninput" max="2017-12-12" min="2015-01-01"/> @@ -248,6 +257,7 @@ Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥å建æ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç» </div> <div style="flex-direction: row;margin-bottom: 16px;justify-content: space-between"> <text class="button" value="setRange" type="primary" @click="setRange"></text> + <text class="button" value="getSelectionRange" type="primary" @click="getSelectionRange"></text> </div> <input type="text" ref="inputselection" placeholder="please input" value="123456789" class="input" @change="onchange" @return = "onreturn" @input="oninput"/> </div> @@ -280,7 +290,6 @@ Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥å建æ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç» </style> <script> - const modal = weex.requireModule('modal') module.exports = { data: function () { return { @@ -320,23 +329,16 @@ Weex å ç½®ç `<input>` ç»ä»¶ç¨æ¥å建æ¥æ¶ç¨æ·è¾å ¥å符çè¾å ¥ç» console.log(this.$refs["inputselection"]); this.$refs["inputselection"].setSelectionRange(2, 6); }, - onfocus () { - console.log('onfocus:'); - modal.toast({ - message: 'onfocus', - duration: 0.8 - }) - }, - onblur () { - console.log('onblur:'); - modal.toast({ - message: 'input blur', - duration: 0.8 - }) + getSelectionRange: function() { + console.log(this.$refs["inputselection"]); + var self = this; + this.$refs["inputselection"].getSelectionRange(function(e) { + self.txtSelection = e.selectionStart +'-' + e.selectionEnd; + }); } } }; </script> ``` -[ä½éªä¸ä¸](http://dotwe.org/vue/dd83d941d2364f2849e45dc3c5d91ab4) +[ä½éªä¸ä¸](http://dotwe.org/vue/3470e4d0194f3879a72d38e2ab02cc9f) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/cn/v-0.10/references/bubble.md ---------------------------------------------------------------------- diff --git a/doc/source/cn/v-0.10/references/bubble.md b/doc/source/cn/v-0.10/references/bubble.md index cb25e05..74b7e98 100644 --- a/doc/source/cn/v-0.10/references/bubble.md +++ b/doc/source/cn/v-0.10/references/bubble.md @@ -2,7 +2,7 @@ title: äºä»¶å泡 type: references order: 1.3 -version: 2.1 +version: 0.10 --- # äºä»¶å泡 <span class="api-version">v0.13+</span> @@ -11,7 +11,7 @@ Weex 1.0 å®ç°äº W3C æ åçäºä»¶å泡æºå¶ã ### ä½¿ç¨ -```javascript +```html <template> <div class="root" onclick="rootClick" bubble="true"> <div> @@ -83,7 +83,7 @@ Weex 1.0 å®ç°äº W3C æ åçäºä»¶å泡æºå¶ã å¨äºä»¶å¤çå½æ°ä¸ï¼å¯ä»¥ä½¿ç¨ `e.stopPropagation()` æ¹æ³ï¼æ¥é»æ¢æ¬æ¬¡äºä»¶åä¸çä¼ éè¿ç¨ã注æï¼`e.stopPropagation()` ä¸ `bubble="true"` ä¸åï¼åè åªä¼å½±åå½åå ç´ ä»¥åç¶å ç´ çä¼ æï¼ä¸ä¼å½±ååå ç´ çä¼ æï¼åè æ¯ä¸ºäºçæ¬å ¼å®¹èå¢å çå¼å ³æºå¶ï¼ä¼å ¨å±å ³éæè å¼å¯å泡æºå¶ï¼ä¸¤è å¯ä»¥å ±ååå¨ä½¿ç¨ï¼å¦ä¸ï¼ -```javascript +```html <template> <div class="root" onclick="rootClick" bubble="true"> <div> http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/references/bubble.md ---------------------------------------------------------------------- diff --git a/doc/source/references/bubble.md b/doc/source/references/bubble.md index c66d9b9..8d2470c 100644 --- a/doc/source/references/bubble.md +++ b/doc/source/references/bubble.md @@ -11,7 +11,7 @@ Weex 2.0 implements the W3C standard event bubbling mechanism. ### Usage -```javascript +```html <template> <div class="root" @click="rootClick" bubble="true"> <text style="font-size: 40px;">{{rootText}}</text> @@ -81,7 +81,7 @@ One thing should be noticed: **For compatibility with previous versions, Weex do In the event handler function, you can use the `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: -```javascript +```html <template> <div class="root" @click="rootClick" bubble="true"> <text style="font-size: 40px;">{{rootText}}</text> http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/references/components/input.md ---------------------------------------------------------------------- diff --git a/doc/source/references/components/input.md b/doc/source/references/components/input.md index 8eea2ad..fdd4d0a 100644 --- a/doc/source/references/components/input.md +++ b/doc/source/references/components/input.md @@ -113,13 +113,15 @@ does not support the common-event 'click'. Please listen to the 'input' or ' <text style="font-size: 40px">oninput: {{txtInput}}</text> <text style="font-size: 40px">onchange: {{txtChange}}</text> <text style="font-size: 40px">onreturntype: {{txtReturnType}}</text> + <text style="font-size: 40px">selection: {{txtSelection}}</text> + </div> <scroller> <div> <div style="background-color: #286090"> <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = text</text> </div> - <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput" @focus="onfocus" @blur="onblur"/> + <input type="text" placeholder="Input Text" class="input" :autofocus=true value="" @change="onchange" @input="oninput"/> </div> <div> @@ -159,6 +161,13 @@ does not support the common-event 'click'. Please listen to the 'input' or ' <div> <div style="background-color: #286090"> + <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = number</text> + </div> + <input type="number" placeholder="Input number" class="input" @change="onchange" @input="oninput"/> + </div> + + <div> + <div style="background-color: #286090"> <text class="title" style="height: 80 ;padding: 20;color: #FFFFFF">input type = date</text> </div> <input type="date" placeholder="Input Date" class="input" @change="onchange" @input="oninput" max="2017-12-12" min="2015-01-01"/> @@ -226,6 +235,7 @@ does not support the common-event 'click'. Please listen to the 'input' or ' </div> <div style="flex-direction: row;margin-bottom: 16px;justify-content: space-between"> <text class="button" value="setRange" type="primary" @click="setRange"></text> + <text class="button" value="getSelectionRange" type="primary" @click="getSelectionRange"></text> </div> <input type="text" ref="inputselection" placeholder="please input" value="123456789" class="input" @change="onchange" @return = "onreturn" @input="oninput"/> </div> @@ -258,7 +268,6 @@ does not support the common-event 'click'. Please listen to the 'input' or ' </style> <script> - const modal = weex.requireModule('modal') module.exports = { data: function () { return { @@ -298,23 +307,16 @@ does not support the common-event 'click'. Please listen to the 'input' or ' console.log(this.$refs["inputselection"]); this.$refs["inputselection"].setSelectionRange(2, 6); }, - onfocus () { - console.log('onfocus:'); - modal.toast({ - message: 'onfocus', - duration: 0.8 - }) - }, - onblur () { - console.log('onblur:'); - modal.toast({ - message: 'input blur', - duration: 0.8 - }) + getSelectionRange: function() { + console.log(this.$refs["inputselection"]); + var self = this; + this.$refs["inputselection"].getSelectionRange(function(e) { + self.txtSelection = e.selectionStart +'-' + e.selectionEnd; + }); } } }; </script> ``` -[try it](http://dotwe.org/vue/dd83d941d2364f2849e45dc3c5d91ab4) +[try it](http://dotwe.org/vue/3470e4d0194f3879a72d38e2ab02cc9f) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bf874113/doc/source/v-0.10/references/bubble.md ---------------------------------------------------------------------- diff --git a/doc/source/v-0.10/references/bubble.md b/doc/source/v-0.10/references/bubble.md index 849ab36..ba59a90 100644 --- a/doc/source/v-0.10/references/bubble.md +++ b/doc/source/v-0.10/references/bubble.md @@ -2,16 +2,16 @@ title: Event Bubble type: references order: 1.3 -version: 2.1 +version: 0.10 --- # Event Bubble <span class="api-version">v0.13+</span> -Weex 2.0 implements the W3C standard event bubbling mechanism. +Weex 1.0 implements the W3C standard event bubbling mechanism. ### Usage -```javascript +```html <template> <div class="root" onclick="rootClick" bubble="true"> <div> @@ -83,7 +83,7 @@ One thing should be noticed: **For compatibility with previous versions, Weex do In the event handler function, you can use the `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: -```javascript +```html <template> <div class="root" onclick="rootClick" bubble="true"> <div>