http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/d332a30e/cn/references/jsfm-apis.html ---------------------------------------------------------------------- diff --git a/cn/references/jsfm-apis.html b/cn/references/jsfm-apis.html deleted file mode 100644 index 809edbf..0000000 --- a/cn/references/jsfm-apis.html +++ /dev/null @@ -1,1413 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - - <title>JS Framework APIs | Weex</title> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> - <meta name="description" content="JS Framework APIsBroadcastChannel v0.9+BroadcastChannel API æ¯ Weex å®ä¾é´éä¿¡ç解å³æ¹æ¡ã åè BroadcastChannel specification. MessageEvent specification API postMessage(message): éè¿æ¶æ¯ééåéç¹å®æ¶æ¯ç»å ¶ä» BroadcastChannel"> -<meta property="og:type" content="website"> -<meta property="og:title" content="JS Framework APIs"> -<meta property="og:url" content="https://weex-project.io/cn/references/jsfm-apis.html"> -<meta property="og:site_name" content="Weex"> -<meta property="og:description" content="JS Framework APIsBroadcastChannel v0.9+BroadcastChannel API æ¯ Weex å®ä¾é´éä¿¡ç解å³æ¹æ¡ã åè BroadcastChannel specification. MessageEvent specification API postMessage(message): éè¿æ¶æ¯ééåéç¹å®æ¶æ¯ç»å ¶ä» BroadcastChannel"> -<meta property="og:updated_time" content="2017-04-28T02:36:21.000Z"> -<meta name="twitter:card" content="summary"> -<meta name="twitter:title" content="JS Framework APIs"> -<meta name="twitter:description" content="JS Framework APIsBroadcastChannel v0.9+BroadcastChannel API æ¯ Weex å®ä¾é´éä¿¡ç解å³æ¹æ¡ã åè BroadcastChannel specification. MessageEvent specification API postMessage(message): éè¿æ¶æ¯ééåéç¹å®æ¶æ¯ç»å ¶ä» BroadcastChannel"> - - <link rel="alternate" href="/atom.xml" title="Weex" type="application/atom+xml"> - - - <link rel="icon" href="//gw.alicdn.com/tps/TB1XNqxPXXXXXcSXVXXXXXXXXXX-64-63.png"> - - - <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css"> - - <link rel="stylesheet" href="/css/style.css"> - <link rel="stylesheet" href="/css/swiper.min.css"> -</head> - -<body id="references" class="lang-cn"> - - <script> - window.PAGE_TYPE = "references"; - window.ROOT = "/" - </script> - <header id="header"> - <div class="navbar"> - <a id="logo" href="/cn/"> - <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" /> - </a> - <div class="main-nav"> - <ul class="links"> - <li><a href="/cn/guide">æç¨</a></li> - <li><a href="/cn/references">æå</a></li> - <li class="dropdown"> - <a href="javascript:;">åè</a> - <ul class="dropdown-menu subnav"> - <li> - <a href="/cn/faq.html">FAQ</a> - </li> - <li> - <a href="/cn/releasenote.html">çæ¬è¯´æ</a> - </li> - </ul> - </li> - <li class="dropdown"> - <a href="javascript:;">å·¥å ·åæå¡</a> - <ul class="dropdown-menu subnav"> - <li> - <a href="/cn/playground.html">Playground</a> - </li> - <li> - <a href="/cn/guide/tools/toolkit.html">Weex-toolkit</a> - </li> - <li> - <a href="http://dotwe.org" target="_blank">Code Snippets</a> - </li> - <li> - <a href="https://market.dotwe.org" target="_blank">Market</a> - </li> - </ul> - </li> - </ul> - <ul class="info"> - <li><a href="https://github.com/apache/incubator-weex/" target="_blank"><span class="btn-github iconfont icon-github"></span></a></li> - </ul> - <ul class="tools"> - <li> - <div class="search"> - <form id="search-form" class="search-form"> <!-- æç´¢æ¡ç¸å ³ --> - <input type="text" id="search-input-header" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/> - <span class="iconfont icon-search"></span> - </form> - <div class="results-panel"> - </div> -</div> - </li> - <li> - <div class="dropdown select-lang"> - <a href="javascript:;" class="dropdown-toggle"> - Language - <span class="caret"></span> - </a> - <ul class="dropdown-menu pick-lang"> - <li> - <a href="/references/jsfm-apis.html" data-lang="en">English</a> - </li> - <li> - <a href="/cn/references/jsfm-apis.html" data-lang="zh-cn">ä¸æ</a> - </li> - </ul> - </div> - </li> - <!--<li></li>--> - </ul> - </div> - </div> - <div id="mobile-nav"> - <a id="logo" href="/cn/"> - <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" /> - </a> - <a class="btn-menu"><span class="iconfont icon-nav"></span></a> - </div> -</header> - - <div id="sidebar" class=""> - <div class="sidebar-menu"> - - <div class="search"> - <form id="search-form" class="search-form"> <!-- æç´¢æ¡ç¸å ³ --> - <input type="text" id="search-input-sidebar" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/> - <span class="iconfont icon-search"></span> - </form> - <div class="results-panel"> - </div> -</div> - - -<div class="doc-nav-version"> - <select class="versionBtn" stype="/cn/references"> - - <option value="2v" selected>v2.x</option> - <option value="1v">v1.x</option> - - </select> -</div> -<div class="summary"> - <h2 class="part-title"> - - æå - - </h2> - <ul class="doc-summary"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <li> - <h3 class="chapter-title"><a href="/cn/references/index.html" class="sidebar-link ">éç¨ç¹æ§</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/ios-apis.html" class="sidebar-link ">iOS APIs</a> - </li> - - <li> - <a href="/cn/references/android-apis.html" class="sidebar-link ">Android APIs</a> - </li> - - <li> - <a href="/cn/references/html5-apis.html" class="sidebar-link ">HTML5 APIs</a> - </li> - - <li> - <a href="/cn/references/jsfm-apis.html" class="sidebar-link current ">JS Framework APIs</a> - </li> - - <li> - <a href="/cn/references/common-style.html" class="sidebar-link ">éç¨æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/text-style.html" class="sidebar-link ">ææ¬æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/color-names.html" class="sidebar-link ">é¢è²å称å表</a> - </li> - - <li> - <a href="/cn/references/gesture.html" class="sidebar-link ">æå¿</a> - </li> - - <li> - <a href="/cn/references/path.html" class="sidebar-link ">Path (è±)</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/components/index.html" class="sidebar-link ">å 建ç»ä»¶</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/components/a.html" class="sidebar-link "><a></a> - </li> - - <li> - <a href="/cn/references/components/indicator.html" class="sidebar-link "><indicator></a> - </li> - - <li> - <a href="/cn/references/components/slider.html" class="sidebar-link "><slider></a> - </li> - - <li> - <a href="/cn/references/components/switch.html" class="sidebar-link "><switch></a> - </li> - - <li> - <a href="/cn/references/components/text.html" class="sidebar-link "><text></a> - </li> - - <li> - <a href="/cn/references/components/textarea.html" class="sidebar-link "><textarea></a> - </li> - - <li> - <a href="/cn/references/components/video.html" class="sidebar-link "><video></a> - </li> - - <li> - <a href="/cn/references/components/web.html" class="sidebar-link "><web></a> - </li> - - <li> - <a href="/cn/references/components/div.html" class="sidebar-link "><div></a> - </li> - - <li> - <a href="/cn/references/components/image.html" class="sidebar-link "><image></a> - </li> - - <li> - <a href="/cn/references/components/list.html" class="sidebar-link "><list></a> - </li> - - <li> - <a href="/cn/references/components/input.html" class="sidebar-link "><input></a> - </li> - - <li> - <a href="/cn/references/components/waterfall.html" class="sidebar-link "><waterfall></a> - </li> - - <li> - <a href="/cn/references/components/cell.html" class="sidebar-link "><cell></a> - </li> - - <li> - <a href="/cn/references/components/loading.html" class="sidebar-link "><loading></a> - </li> - - <li> - <a href="/cn/references/components/refresh.html" class="sidebar-link "><refresh></a> - </li> - - <li> - <a href="/cn/references/components/scroller.html" class="sidebar-link "><scroller></a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/modules/index.html" class="sidebar-link ">å 建模å</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/modules/animation.html" class="sidebar-link ">animation</a> - </li> - - <li> - <a href="/cn/references/modules/websocket.html" class="sidebar-link ">WebSocket</a> - </li> - - <li> - <a href="/cn/references/modules/picker.html" class="sidebar-link ">picker</a> - </li> - - <li> - <a href="/cn/references/modules/clipboard.html" class="sidebar-link ">clipboard</a> - </li> - - <li> - <a href="/cn/references/modules/dom.html" class="sidebar-link ">dom</a> - </li> - - <li> - <a href="/cn/references/modules/modal.html" class="sidebar-link ">modal</a> - </li> - - <li> - <a href="/cn/references/modules/navigator.html" class="sidebar-link ">navigator</a> - </li> - - <li> - <a href="/cn/references/modules/storage.html" class="sidebar-link ">storage</a> - </li> - - <li> - <a href="/cn/references/modules/stream.html" class="sidebar-link ">stream</a> - </li> - - <li> - <a href="/cn/references/modules/webview.html" class="sidebar-link ">webview</a> - </li> - - <li> - <a href="/cn/references/modules/globalevent.html" class="sidebar-link ">globalEvent</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/unit.html" class="sidebar-link ">CSS åä½</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/common-event.html" class="sidebar-link ">éç¨äºä»¶</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/native-dom-api.html" class="sidebar-link ">Native DOM APIs</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/weex-variable.html" class="sidebar-link ">Weex å®ä¾åé</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/web-standards.html" class="sidebar-link ">Web æ å</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/js-service/index.html" class="sidebar-link ">JS Service</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/vue/index.html" class="sidebar-link ">Vue</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/vue/difference-with-web.html" class="sidebar-link ">Vue 2.x å¨ Weex å Web ä¸çå·®å¼</a> - </li> - - <li> - <a href="/cn/references/vue/difference-of-vuex.html" class="sidebar-link ">ä½¿ç¨ Vuex å vue-router</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/advanced/index.html" class="sidebar-link ">é«é¶ç¥è¯</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/advanced/extend-to-ios.html" class="sidebar-link ">iOS æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-android.html" class="sidebar-link ">Android æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-html5.html" class="sidebar-link ">HTML5 æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-jsfm.html" class="sidebar-link ">æå± JS framework</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-android.html" class="sidebar-link ">éæ Devtools å° Android</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-ios.html" class="sidebar-link ">éæ Devtools å° iOS</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/platform-difference.html" class="sidebar-link ">Weex å Web å¹³å°çå·®å¼</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/migration/index.html" class="sidebar-link ">è¿ç§»</a> - </li> - - <li> - <a href="/cn/references/migration/migration-from-weex.html" class="sidebar-link ">å¦ä½å°åæ Weex 项ç®æ¹é æ Vue çæ¬</a> - </li> - - <li> - <a href="/cn/references/migration/difference.html" class="sidebar-link ">Weex å Vue 2.x çè¯æ³å·®å¼</a> - </li> - - </ul> - - </li> - - - </ul> -</div> - - <a class="btn-close-sidebar iconfont icon-close"></a> - </div> -</div> - - <div class="article-wrapper page-layout"> - <div class="doc-nav"> - - - -<div class="doc-nav-version"> - <select class="versionBtn" stype="/cn/references"> - - <option value="2v" selected>v2.x</option> - <option value="1v">v1.x</option> - - </select> -</div> -<div class="summary"> - <h2 class="part-title"> - - æå - - </h2> - <ul class="doc-summary"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <li> - <h3 class="chapter-title"><a href="/cn/references/index.html" class="sidebar-link ">éç¨ç¹æ§</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/ios-apis.html" class="sidebar-link ">iOS APIs</a> - </li> - - <li> - <a href="/cn/references/android-apis.html" class="sidebar-link ">Android APIs</a> - </li> - - <li> - <a href="/cn/references/html5-apis.html" class="sidebar-link ">HTML5 APIs</a> - </li> - - <li> - <a href="/cn/references/jsfm-apis.html" class="sidebar-link current ">JS Framework APIs</a> - </li> - - <li> - <a href="/cn/references/common-style.html" class="sidebar-link ">éç¨æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/text-style.html" class="sidebar-link ">ææ¬æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/color-names.html" class="sidebar-link ">é¢è²å称å表</a> - </li> - - <li> - <a href="/cn/references/gesture.html" class="sidebar-link ">æå¿</a> - </li> - - <li> - <a href="/cn/references/path.html" class="sidebar-link ">Path (è±)</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/components/index.html" class="sidebar-link ">å 建ç»ä»¶</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/components/a.html" class="sidebar-link "><a></a> - </li> - - <li> - <a href="/cn/references/components/indicator.html" class="sidebar-link "><indicator></a> - </li> - - <li> - <a href="/cn/references/components/slider.html" class="sidebar-link "><slider></a> - </li> - - <li> - <a href="/cn/references/components/switch.html" class="sidebar-link "><switch></a> - </li> - - <li> - <a href="/cn/references/components/text.html" class="sidebar-link "><text></a> - </li> - - <li> - <a href="/cn/references/components/textarea.html" class="sidebar-link "><textarea></a> - </li> - - <li> - <a href="/cn/references/components/video.html" class="sidebar-link "><video></a> - </li> - - <li> - <a href="/cn/references/components/web.html" class="sidebar-link "><web></a> - </li> - - <li> - <a href="/cn/references/components/div.html" class="sidebar-link "><div></a> - </li> - - <li> - <a href="/cn/references/components/image.html" class="sidebar-link "><image></a> - </li> - - <li> - <a href="/cn/references/components/list.html" class="sidebar-link "><list></a> - </li> - - <li> - <a href="/cn/references/components/input.html" class="sidebar-link "><input></a> - </li> - - <li> - <a href="/cn/references/components/waterfall.html" class="sidebar-link "><waterfall></a> - </li> - - <li> - <a href="/cn/references/components/cell.html" class="sidebar-link "><cell></a> - </li> - - <li> - <a href="/cn/references/components/loading.html" class="sidebar-link "><loading></a> - </li> - - <li> - <a href="/cn/references/components/refresh.html" class="sidebar-link "><refresh></a> - </li> - - <li> - <a href="/cn/references/components/scroller.html" class="sidebar-link "><scroller></a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/modules/index.html" class="sidebar-link ">å 建模å</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/modules/animation.html" class="sidebar-link ">animation</a> - </li> - - <li> - <a href="/cn/references/modules/websocket.html" class="sidebar-link ">WebSocket</a> - </li> - - <li> - <a href="/cn/references/modules/picker.html" class="sidebar-link ">picker</a> - </li> - - <li> - <a href="/cn/references/modules/clipboard.html" class="sidebar-link ">clipboard</a> - </li> - - <li> - <a href="/cn/references/modules/dom.html" class="sidebar-link ">dom</a> - </li> - - <li> - <a href="/cn/references/modules/modal.html" class="sidebar-link ">modal</a> - </li> - - <li> - <a href="/cn/references/modules/navigator.html" class="sidebar-link ">navigator</a> - </li> - - <li> - <a href="/cn/references/modules/storage.html" class="sidebar-link ">storage</a> - </li> - - <li> - <a href="/cn/references/modules/stream.html" class="sidebar-link ">stream</a> - </li> - - <li> - <a href="/cn/references/modules/webview.html" class="sidebar-link ">webview</a> - </li> - - <li> - <a href="/cn/references/modules/globalevent.html" class="sidebar-link ">globalEvent</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/unit.html" class="sidebar-link ">CSS åä½</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/common-event.html" class="sidebar-link ">éç¨äºä»¶</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/native-dom-api.html" class="sidebar-link ">Native DOM APIs</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/weex-variable.html" class="sidebar-link ">Weex å®ä¾åé</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/web-standards.html" class="sidebar-link ">Web æ å</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/js-service/index.html" class="sidebar-link ">JS Service</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/vue/index.html" class="sidebar-link ">Vue</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/vue/difference-with-web.html" class="sidebar-link ">Vue 2.x å¨ Weex å Web ä¸çå·®å¼</a> - </li> - - <li> - <a href="/cn/references/vue/difference-of-vuex.html" class="sidebar-link ">ä½¿ç¨ Vuex å vue-router</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/advanced/index.html" class="sidebar-link ">é«é¶ç¥è¯</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/advanced/extend-to-ios.html" class="sidebar-link ">iOS æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-android.html" class="sidebar-link ">Android æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-html5.html" class="sidebar-link ">HTML5 æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-jsfm.html" class="sidebar-link ">æå± JS framework</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-android.html" class="sidebar-link ">éæ Devtools å° Android</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-ios.html" class="sidebar-link ">éæ Devtools å° iOS</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/platform-difference.html" class="sidebar-link ">Weex å Web å¹³å°çå·®å¼</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/migration/index.html" class="sidebar-link ">è¿ç§»</a> - </li> - - <li> - <a href="/cn/references/migration/migration-from-weex.html" class="sidebar-link ">å¦ä½å°åæ Weex 项ç®æ¹é æ Vue çæ¬</a> - </li> - - <li> - <a href="/cn/references/migration/difference.html" class="sidebar-link ">Weex å Vue 2.x çè¯æ³å·®å¼</a> - </li> - - </ul> - - </li> - - - </ul> -</div> - </div> - - -<article class="article article-type-references"> - <div class="article-entry" itemprop="articleBody"> - <header class="article-header"> - - - <h1 class="article-title" itemprop="name"> - JS Framework APIs - </h1> - - - <time class="article-date" datetime="2017-04-28T02:36:21.000Z">Updated time: 28/04/2017</time> -</header> - <h1 id="JS-Framework-APIs"><a href="#JS-Framework-APIs" class="headerlink" title="JS Framework APIs"></a>JS Framework APIs</h1><h2 id="BroadcastChannel-v0-9"><a href="#BroadcastChannel-v0-9" class="headerlink" title="BroadcastChannel v0.9+"></a>BroadcastChannel <span class="api-version">v0.9+</span></h2><p><code>BroadcastChannel</code> API æ¯ Weex å®ä¾é´éä¿¡ç解å³æ¹æ¡ã</p> -<h3 id="åè"><a href="#åè" class="headerlink" title="åè"></a>åè</h3><ul> -<li><a href="https://html.spec.whatwg.org/multipage/comms.html#broadcasting-to-other-browsing-contexts" target="_blank" rel="external">BroadcastChannel specification</a>.</li> -<li><a href="https://html.spec.whatwg.org/multipage/comms.html#messageevent" target="_blank" rel="external">MessageEvent specification</a></li> -</ul> -<h3 id="API"><a href="#API" class="headerlink" title="API"></a>API</h3><ul> -<li><code>postMessage(message)</code>: éè¿æ¶æ¯ééåéç¹å®æ¶æ¯ç»å ¶ä» BroadcastChannel 对象ã</li> -<li><code>close</code>: å ³é BroadcastChannel 对象ï¼ä»¥ä¾¿åå¾åæ¶ã</li> -<li><code>onmessage</code>: Event å¤çå½æ°, å½ BroadcastChannel 对象æ¥æ¶å°æ¶æ¯æ¶è§¦åã</li> -</ul> -<h3 id="使ç¨"><a href="#使ç¨" class="headerlink" title="使ç¨"></a>使ç¨</h3><figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line"><span class="keyword">const</span> Stack = <span class="keyword">new</span> BroadcastChannel(<span class="string">'Avengers'</span>)</div><div class="line">Stack.onmessage = <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>{</div><div class="line"> <span class="built_in">console</span>.log(event.data) <span class="comment">// in this case, it's "Hulk Smash !!!"</span></div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">// in another instance</span></div><div class="line"><span class="keyword">const</span> Hulk = <span class="keyword">new</span> BroadcastChannel(<span class="string">'Avengers'</span>)</div><div class="line">Hulk.postMessage(<span class="string">"Hulk Smash !!!"</span>)</div></pre></td></tr></t able></figure> -<p>è¿è¡ä»¥ä¸ä»£ç ï¼Stack å¯ä»¥ä» Hulk æ¥æ¶æ¶æ¯ã</p> -<h3 id="注æ"><a href="#注æ" class="headerlink" title="注æ"></a>注æ</h3><p>éè¦æ³¨æçæ¯: <strong> <code>message</code> å¦ææ¯ä¸ä¸ªå¯¹è±¡ï¼è¯¥å¯¹è±¡ä¸ä¼æ·±æ·è´ã</strong></p> -<p>åè以ä¸ä¾å</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line"><span class="keyword">const</span> a = <span class="keyword">new</span> BroadcastChannel(<span class="string">'app'</span>)</div><div class="line"><span class="keyword">const</span> b = <span class="keyword">new</span> BroadcastChannel(<span class="string">'app'</span>)</div><div class="line"></div><div class="line"><span class="keyword">const</span> message = {</div><div class="line"> <span class="attr">lists</span>: [<span class="string">'A'</span>, <span class="string">'B'</span>]</div><div class="line">}</div><div class="line"></div><div class="line">a.onmessage = <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>{</div><div class="line"></div><div class="line"> <span class="comment">// in this case, event.data is a reference of message</span></div><div class="line"> <span class="built_in">console</span>.assert(event.data === message)</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line">b.postMessage(message)</div></pre></td></tr></table></figure> -<p>å¨è¿ä¸ªä¾åä¸ï¼<code>event.data</code> å ¨çäº <code>message</code>ã</p> -<p>ä¸æ·±æ·è´ç¸æ¯ï¼è¿ç§æ¹å¼è½å¤æé«æç并åå°å åæ¶èãä½æ¯ï¼ä¸å»ºè®®å¼åè å¨ä½¿ç¨æ¶ç¼åæä¿®æ¹äºä»¶å¯¹è±¡ (ææç±»åçäºä»¶å¤çç¨åºé½åºè¯¥ææ¤éå¶)ã</p> - - </div> - -</article> -</div> - - <footer id="footer"> - <div class="row clearfix"> - <div class="dropdown select-lang"> - <a href="javascript:;" class="dropdown-toggle"> - Language - <span class="caret"></span> - </a> - <ul class="dropdown-menu pick-lang"> - <li> - <a href="/references/jsfm-apis.html" data-lang="en">English</a> - </li> - <li> - <a href="/cn/references/jsfm-apis.html" data-lang="zh-cn">ä¸æ</a> - </li> - </ul> - </div> - </div> - <div class="disclaimer"> - <div><img src="//gw.alicdn.com/tfs/TB1pTBZQFXXXXX9XXXXXXXXXXXX-794-280.png" width="200px" alt="Apache Incubator"></div> - <div><span class="title">Disclaimer:</span> Apache Weex is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</div> - <br/> - </div> - <hr> - <div class="row"> - <p> <img src="//gw.alicdn.com/tfs/TB1bg8SQFXXXXcHXXXXXXXXXXXX-85-170.png" height="50px" alt="Apache"><span>Copyright(c) 2017 The Apache Software Foundation. Licensed under the </span> <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a></p> - </div> - <div class="row clearfix"> - <div></div> - </div> -</footer> - <div style="display: none;"> - <script src="//s95.cnzz.com/z_stat.php?id=1261496509&web_id=1261496509" language="JavaScript"></script> -</div> - - <script src="/js/reqwest.js"></script> - <script src="/js/common.js"></script> -</body> -</html>
http://git-wip-us.apache.org/repos/asf/incubator-weex-site/blob/d332a30e/cn/references/migration/difference.html ---------------------------------------------------------------------- diff --git a/cn/references/migration/difference.html b/cn/references/migration/difference.html deleted file mode 100644 index b6ebc5c..0000000 --- a/cn/references/migration/difference.html +++ /dev/null @@ -1,1654 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - - <title>Weex å Vue 2.x çè¯æ³å·®å¼ | Weex</title> - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> - <meta name="description" content="Weex å Vue 2.x çè¯æ³å·®å¼Overview Weex Vue çå½å¨æ ready: function() {} mounted: function() {} æ¡ä»¶æ令 if=&quot;{{!foo}}&quot; v-if=&quot;!foo&quot; 循ç¯æ令 repeat=&quot;{{item in list}}&quot; v-for=&quo"> -<meta property="og:type" content="website"> -<meta property="og:title" content="Weex å Vue 2.x çè¯æ³å·®å¼"> -<meta property="og:url" content="https://weex-project.io/cn/references/migration/difference.html"> -<meta property="og:site_name" content="Weex"> -<meta property="og:description" content="Weex å Vue 2.x çè¯æ³å·®å¼Overview Weex Vue çå½å¨æ ready: function() {} mounted: function() {} æ¡ä»¶æ令 if=&quot;{{!foo}}&quot; v-if=&quot;!foo&quot; 循ç¯æ令 repeat=&quot;{{item in list}}&quot; v-for=&quo"> -<meta property="og:updated_time" content="2017-04-28T02:36:21.000Z"> -<meta name="twitter:card" content="summary"> -<meta name="twitter:title" content="Weex å Vue 2.x çè¯æ³å·®å¼"> -<meta name="twitter:description" content="Weex å Vue 2.x çè¯æ³å·®å¼Overview Weex Vue çå½å¨æ ready: function() {} mounted: function() {} æ¡ä»¶æ令 if=&quot;{{!foo}}&quot; v-if=&quot;!foo&quot; 循ç¯æ令 repeat=&quot;{{item in list}}&quot; v-for=&quo"> - - <link rel="alternate" href="/atom.xml" title="Weex" type="application/atom+xml"> - - - <link rel="icon" href="//gw.alicdn.com/tps/TB1XNqxPXXXXXcSXVXXXXXXXXXX-64-63.png"> - - - <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css"> - - <link rel="stylesheet" href="/css/style.css"> - <link rel="stylesheet" href="/css/swiper.min.css"> -</head> - -<body id="references" class="lang-cn"> - - <script> - window.PAGE_TYPE = "references"; - window.ROOT = "/" - </script> - <header id="header"> - <div class="navbar"> - <a id="logo" href="/cn/"> - <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" /> - </a> - <div class="main-nav"> - <ul class="links"> - <li><a href="/cn/guide">æç¨</a></li> - <li><a href="/cn/references">æå</a></li> - <li class="dropdown"> - <a href="javascript:;">åè</a> - <ul class="dropdown-menu subnav"> - <li> - <a href="/cn/faq.html">FAQ</a> - </li> - <li> - <a href="/cn/releasenote.html">çæ¬è¯´æ</a> - </li> - </ul> - </li> - <li class="dropdown"> - <a href="javascript:;">å·¥å ·åæå¡</a> - <ul class="dropdown-menu subnav"> - <li> - <a href="/cn/playground.html">Playground</a> - </li> - <li> - <a href="/cn/guide/tools/toolkit.html">Weex-toolkit</a> - </li> - <li> - <a href="http://dotwe.org" target="_blank">Code Snippets</a> - </li> - <li> - <a href="https://market.dotwe.org" target="_blank">Market</a> - </li> - </ul> - </li> - </ul> - <ul class="info"> - <li><a href="https://github.com/apache/incubator-weex/" target="_blank"><span class="btn-github iconfont icon-github"></span></a></li> - </ul> - <ul class="tools"> - <li> - <div class="search"> - <form id="search-form" class="search-form"> <!-- æç´¢æ¡ç¸å ³ --> - <input type="text" id="search-input-header" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/> - <span class="iconfont icon-search"></span> - </form> - <div class="results-panel"> - </div> -</div> - </li> - <li> - <div class="dropdown select-lang"> - <a href="javascript:;" class="dropdown-toggle"> - Language - <span class="caret"></span> - </a> - <ul class="dropdown-menu pick-lang"> - <li> - <a href="/references/migration/difference.html" data-lang="en">English</a> - </li> - <li> - <a href="/cn/references/migration/difference.html" data-lang="zh-cn">ä¸æ</a> - </li> - </ul> - </div> - </li> - <!--<li></li>--> - </ul> - </div> - </div> - <div id="mobile-nav"> - <a id="logo" href="/cn/"> - <img src="//img.alicdn.com/tps/TB1zBLaPXXXXXXeXXXXXXXXXXXX-121-59.svg" /> - </a> - <a class="btn-menu"><span class="iconfont icon-nav"></span></a> - </div> -</header> - - <div id="sidebar" class=""> - <div class="sidebar-menu"> - - <div class="search"> - <form id="search-form" class="search-form"> <!-- æç´¢æ¡ç¸å ³ --> - <input type="text" id="search-input-sidebar" name="q" results="0" class="form-control search-input" autocomplete="off" autocorrect="off"/> - <span class="iconfont icon-search"></span> - </form> - <div class="results-panel"> - </div> -</div> - - -<div class="doc-nav-version"> - <select class="versionBtn" stype="/cn/references"> - - <option value="2v" selected>v2.x</option> - <option value="1v">v1.x</option> - - </select> -</div> -<div class="summary"> - <h2 class="part-title"> - - æå - - </h2> - <ul class="doc-summary"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <li> - <h3 class="chapter-title"><a href="/cn/references/index.html" class="sidebar-link ">éç¨ç¹æ§</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/ios-apis.html" class="sidebar-link ">iOS APIs</a> - </li> - - <li> - <a href="/cn/references/android-apis.html" class="sidebar-link ">Android APIs</a> - </li> - - <li> - <a href="/cn/references/html5-apis.html" class="sidebar-link ">HTML5 APIs</a> - </li> - - <li> - <a href="/cn/references/jsfm-apis.html" class="sidebar-link ">JS Framework APIs</a> - </li> - - <li> - <a href="/cn/references/common-style.html" class="sidebar-link ">éç¨æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/text-style.html" class="sidebar-link ">ææ¬æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/color-names.html" class="sidebar-link ">é¢è²å称å表</a> - </li> - - <li> - <a href="/cn/references/gesture.html" class="sidebar-link ">æå¿</a> - </li> - - <li> - <a href="/cn/references/path.html" class="sidebar-link ">Path (è±)</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/components/index.html" class="sidebar-link ">å 建ç»ä»¶</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/components/a.html" class="sidebar-link "><a></a> - </li> - - <li> - <a href="/cn/references/components/indicator.html" class="sidebar-link "><indicator></a> - </li> - - <li> - <a href="/cn/references/components/slider.html" class="sidebar-link "><slider></a> - </li> - - <li> - <a href="/cn/references/components/switch.html" class="sidebar-link "><switch></a> - </li> - - <li> - <a href="/cn/references/components/text.html" class="sidebar-link "><text></a> - </li> - - <li> - <a href="/cn/references/components/textarea.html" class="sidebar-link "><textarea></a> - </li> - - <li> - <a href="/cn/references/components/video.html" class="sidebar-link "><video></a> - </li> - - <li> - <a href="/cn/references/components/web.html" class="sidebar-link "><web></a> - </li> - - <li> - <a href="/cn/references/components/div.html" class="sidebar-link "><div></a> - </li> - - <li> - <a href="/cn/references/components/image.html" class="sidebar-link "><image></a> - </li> - - <li> - <a href="/cn/references/components/list.html" class="sidebar-link "><list></a> - </li> - - <li> - <a href="/cn/references/components/input.html" class="sidebar-link "><input></a> - </li> - - <li> - <a href="/cn/references/components/waterfall.html" class="sidebar-link "><waterfall></a> - </li> - - <li> - <a href="/cn/references/components/cell.html" class="sidebar-link "><cell></a> - </li> - - <li> - <a href="/cn/references/components/loading.html" class="sidebar-link "><loading></a> - </li> - - <li> - <a href="/cn/references/components/refresh.html" class="sidebar-link "><refresh></a> - </li> - - <li> - <a href="/cn/references/components/scroller.html" class="sidebar-link "><scroller></a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/modules/index.html" class="sidebar-link ">å 建模å</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/modules/animation.html" class="sidebar-link ">animation</a> - </li> - - <li> - <a href="/cn/references/modules/websocket.html" class="sidebar-link ">WebSocket</a> - </li> - - <li> - <a href="/cn/references/modules/picker.html" class="sidebar-link ">picker</a> - </li> - - <li> - <a href="/cn/references/modules/clipboard.html" class="sidebar-link ">clipboard</a> - </li> - - <li> - <a href="/cn/references/modules/dom.html" class="sidebar-link ">dom</a> - </li> - - <li> - <a href="/cn/references/modules/modal.html" class="sidebar-link ">modal</a> - </li> - - <li> - <a href="/cn/references/modules/navigator.html" class="sidebar-link ">navigator</a> - </li> - - <li> - <a href="/cn/references/modules/storage.html" class="sidebar-link ">storage</a> - </li> - - <li> - <a href="/cn/references/modules/stream.html" class="sidebar-link ">stream</a> - </li> - - <li> - <a href="/cn/references/modules/webview.html" class="sidebar-link ">webview</a> - </li> - - <li> - <a href="/cn/references/modules/globalevent.html" class="sidebar-link ">globalEvent</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/unit.html" class="sidebar-link ">CSS åä½</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/common-event.html" class="sidebar-link ">éç¨äºä»¶</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/native-dom-api.html" class="sidebar-link ">Native DOM APIs</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/weex-variable.html" class="sidebar-link ">Weex å®ä¾åé</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/web-standards.html" class="sidebar-link ">Web æ å</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/js-service/index.html" class="sidebar-link ">JS Service</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/vue/index.html" class="sidebar-link ">Vue</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/vue/difference-with-web.html" class="sidebar-link ">Vue 2.x å¨ Weex å Web ä¸çå·®å¼</a> - </li> - - <li> - <a href="/cn/references/vue/difference-of-vuex.html" class="sidebar-link ">ä½¿ç¨ Vuex å vue-router</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/advanced/index.html" class="sidebar-link ">é«é¶ç¥è¯</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/advanced/extend-to-ios.html" class="sidebar-link ">iOS æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-android.html" class="sidebar-link ">Android æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-html5.html" class="sidebar-link ">HTML5 æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-jsfm.html" class="sidebar-link ">æå± JS framework</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-android.html" class="sidebar-link ">éæ Devtools å° Android</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-ios.html" class="sidebar-link ">éæ Devtools å° iOS</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/platform-difference.html" class="sidebar-link ">Weex å Web å¹³å°çå·®å¼</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/migration/index.html" class="sidebar-link ">è¿ç§»</a> - </li> - - <li> - <a href="/cn/references/migration/migration-from-weex.html" class="sidebar-link ">å¦ä½å°åæ Weex 项ç®æ¹é æ Vue çæ¬</a> - </li> - - <li> - <a href="/cn/references/migration/difference.html" class="sidebar-link current ">Weex å Vue 2.x çè¯æ³å·®å¼</a> - </li> - - </ul> - - </li> - - - </ul> -</div> - - <a class="btn-close-sidebar iconfont icon-close"></a> - </div> -</div> - - <div class="article-wrapper page-layout"> - <div class="doc-nav"> - - - -<div class="doc-nav-version"> - <select class="versionBtn" stype="/cn/references"> - - <option value="2v" selected>v2.x</option> - <option value="1v">v1.x</option> - - </select> -</div> -<div class="summary"> - <h2 class="part-title"> - - æå - - </h2> - <ul class="doc-summary"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <li> - <h3 class="chapter-title"><a href="/cn/references/index.html" class="sidebar-link ">éç¨ç¹æ§</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/ios-apis.html" class="sidebar-link ">iOS APIs</a> - </li> - - <li> - <a href="/cn/references/android-apis.html" class="sidebar-link ">Android APIs</a> - </li> - - <li> - <a href="/cn/references/html5-apis.html" class="sidebar-link ">HTML5 APIs</a> - </li> - - <li> - <a href="/cn/references/jsfm-apis.html" class="sidebar-link ">JS Framework APIs</a> - </li> - - <li> - <a href="/cn/references/common-style.html" class="sidebar-link ">éç¨æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/text-style.html" class="sidebar-link ">ææ¬æ ·å¼</a> - </li> - - <li> - <a href="/cn/references/color-names.html" class="sidebar-link ">é¢è²å称å表</a> - </li> - - <li> - <a href="/cn/references/gesture.html" class="sidebar-link ">æå¿</a> - </li> - - <li> - <a href="/cn/references/path.html" class="sidebar-link ">Path (è±)</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/components/index.html" class="sidebar-link ">å 建ç»ä»¶</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/components/a.html" class="sidebar-link "><a></a> - </li> - - <li> - <a href="/cn/references/components/indicator.html" class="sidebar-link "><indicator></a> - </li> - - <li> - <a href="/cn/references/components/slider.html" class="sidebar-link "><slider></a> - </li> - - <li> - <a href="/cn/references/components/switch.html" class="sidebar-link "><switch></a> - </li> - - <li> - <a href="/cn/references/components/text.html" class="sidebar-link "><text></a> - </li> - - <li> - <a href="/cn/references/components/textarea.html" class="sidebar-link "><textarea></a> - </li> - - <li> - <a href="/cn/references/components/video.html" class="sidebar-link "><video></a> - </li> - - <li> - <a href="/cn/references/components/web.html" class="sidebar-link "><web></a> - </li> - - <li> - <a href="/cn/references/components/div.html" class="sidebar-link "><div></a> - </li> - - <li> - <a href="/cn/references/components/image.html" class="sidebar-link "><image></a> - </li> - - <li> - <a href="/cn/references/components/list.html" class="sidebar-link "><list></a> - </li> - - <li> - <a href="/cn/references/components/input.html" class="sidebar-link "><input></a> - </li> - - <li> - <a href="/cn/references/components/waterfall.html" class="sidebar-link "><waterfall></a> - </li> - - <li> - <a href="/cn/references/components/cell.html" class="sidebar-link "><cell></a> - </li> - - <li> - <a href="/cn/references/components/loading.html" class="sidebar-link "><loading></a> - </li> - - <li> - <a href="/cn/references/components/refresh.html" class="sidebar-link "><refresh></a> - </li> - - <li> - <a href="/cn/references/components/scroller.html" class="sidebar-link "><scroller></a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/modules/index.html" class="sidebar-link ">å 建模å</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/modules/animation.html" class="sidebar-link ">animation</a> - </li> - - <li> - <a href="/cn/references/modules/websocket.html" class="sidebar-link ">WebSocket</a> - </li> - - <li> - <a href="/cn/references/modules/picker.html" class="sidebar-link ">picker</a> - </li> - - <li> - <a href="/cn/references/modules/clipboard.html" class="sidebar-link ">clipboard</a> - </li> - - <li> - <a href="/cn/references/modules/dom.html" class="sidebar-link ">dom</a> - </li> - - <li> - <a href="/cn/references/modules/modal.html" class="sidebar-link ">modal</a> - </li> - - <li> - <a href="/cn/references/modules/navigator.html" class="sidebar-link ">navigator</a> - </li> - - <li> - <a href="/cn/references/modules/storage.html" class="sidebar-link ">storage</a> - </li> - - <li> - <a href="/cn/references/modules/stream.html" class="sidebar-link ">stream</a> - </li> - - <li> - <a href="/cn/references/modules/webview.html" class="sidebar-link ">webview</a> - </li> - - <li> - <a href="/cn/references/modules/globalevent.html" class="sidebar-link ">globalEvent</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/unit.html" class="sidebar-link ">CSS åä½</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/common-event.html" class="sidebar-link ">éç¨äºä»¶</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/native-dom-api.html" class="sidebar-link ">Native DOM APIs</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/weex-variable.html" class="sidebar-link ">Weex å®ä¾åé</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/web-standards.html" class="sidebar-link ">Web æ å</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/js-service/index.html" class="sidebar-link ">JS Service</a></h3> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/vue/index.html" class="sidebar-link ">Vue</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/vue/difference-with-web.html" class="sidebar-link ">Vue 2.x å¨ Weex å Web ä¸çå·®å¼</a> - </li> - - <li> - <a href="/cn/references/vue/difference-of-vuex.html" class="sidebar-link ">ä½¿ç¨ Vuex å vue-router</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/advanced/index.html" class="sidebar-link ">é«é¶ç¥è¯</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/advanced/extend-to-ios.html" class="sidebar-link ">iOS æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-android.html" class="sidebar-link ">Android æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-to-html5.html" class="sidebar-link ">HTML5 æ©å±</a> - </li> - - <li> - <a href="/cn/references/advanced/extend-jsfm.html" class="sidebar-link ">æå± JS framework</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-android.html" class="sidebar-link ">éæ Devtools å° Android</a> - </li> - - <li> - <a href="/cn/references/advanced/integrate-devtool-to-ios.html" class="sidebar-link ">éæ Devtools å° iOS</a> - </li> - - </ul> - - </li> - - <li> - <h3 class="chapter-title"><a href="/cn/references/platform-difference.html" class="sidebar-link ">Weex å Web å¹³å°çå·®å¼</a></h3> - - <ul class="chapter"> - - <li> - <a href="/cn/references/migration/index.html" class="sidebar-link ">è¿ç§»</a> - </li> - - <li> - <a href="/cn/references/migration/migration-from-weex.html" class="sidebar-link ">å¦ä½å°åæ Weex 项ç®æ¹é æ Vue çæ¬</a> - </li> - - <li> - <a href="/cn/references/migration/difference.html" class="sidebar-link current ">Weex å Vue 2.x çè¯æ³å·®å¼</a> - </li> - - </ul> - - </li> - - - </ul> -</div> - </div> - - -<article class="article article-type-references"> - <div class="article-entry" itemprop="articleBody"> - <header class="article-header"> - - - <h1 class="article-title" itemprop="name"> - Weex å Vue 2.x çè¯æ³å·®å¼ - </h1> - - - <time class="article-date" datetime="2017-04-28T02:36:21.000Z">Updated time: 28/04/2017</time> -</header> - <h1 id="Weex-å-Vue-2-x-çè¯æ³å·®å¼"><a href="#Weex-å-Vue-2-x-çè¯æ³å·®å¼" class="headerlink" title="Weex å Vue 2.x çè¯æ³å·®å¼"></a>Weex å Vue 2.x çè¯æ³å·®å¼</h1><h2 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h2><table> -<thead> -<tr> -<th></th> -<th>Weex</th> -<th>Vue</th> -</tr> -</thead> -<tbody> -<tr> -<td>çå½å¨æ</td> -<td><code>ready: function() {}</code></td> -<td><code>mounted: function() {}</code></td> -</tr> -<tr> -<td>æ¡ä»¶æ令</td> -<td><code>if="{{!foo}}"</code></td> -<td><code>v-if="!foo"</code></td> -</tr> -<tr> -<td>循ç¯æ令</td> -<td><code>repeat="{{item in list}}"</code></td> -<td><code>v-for="item in list"</code></td> -</tr> -<tr> -<td>æ ·å¼ç±»å</td> -<td><code>class="btn btn-{{type}}"</code></td> -<td><code>:class="['btn', 'btn-' + type]"</code></td> -</tr> -<tr> -<td>å èæ ·å¼</td> -<td><code>style="color:{{textColor}}"</code></td> -<td><code>:style="{ color: textColor }"</code></td> -</tr> -<tr> -<td>äºä»¶ç»å®</td> -<td><code>onclick="handler"</code></td> -<td><code>@click="handler"</code></td> -</tr> -<tr> -<td>åçäºä»¶</td> -<td><code>onclick="xxx"</code></td> -<td><code>@click.native="xxx"</code></td> -</tr> -<tr> -<td>æ°æ®ç»å®</td> -<td><code>src="{{rightItemSrc}}"</code></td> -<td><code>:src="rightItemSrc"</code></td> -</tr> -<tr> -<td>å 容/槽</td> -<td><code><content></content></code></td> -<td><code><slot></slot></code></td> -</tr> -<tr> -<td>æ°æ®åå§å</td> -<td><code>data: { value: 'x' }</code></td> -<td><code>data: function() { return { value: 'x' } }</code></td> -</tr> -<tr> -<td>æ ç¾ ID</td> -<td><code>id="xxx"</code></td> -<td><code>ref="xxx"</code></td> -</tr> -<tr> -<td>è·åèç¹</td> -<td><code>this.$el('xxx')</code></td> -<td><code>this.$refs.xxx</code></td> -</tr> -</tbody> -</table> -<h2 id="Reference"><a href="#Reference" class="headerlink" title="Reference"></a>Reference</h2><p>See the source code of <code>weex-vue-migration</code> for more details:</p> -<ul> -<li><a href="https://github.com/songsiqi/weex-vue-migration/blob/master/src/template-rewriter/rewriter.js" target="_blank" rel="external">template-rewriter</a></li> -<li><a href="https://github.com/songsiqi/weex-vue-migration/blob/master/src/script-rewriter/rewriter.js" target="_blank" rel="external">script-rewriter</a></li> -</ul> -<h2 id="LifeCycle-Hooks-çå½å¨æé©å"><a href="#LifeCycle-Hooks-çå½å¨æé©å" class="headerlink" title="LifeCycle Hooks çå½å¨æé©å"></a>LifeCycle Hooks çå½å¨æé©å</h2><table> -<thead> -<tr> -<th>weex</th> -<th>vue</th> -<th>Description</th> -</tr> -</thead> -<tbody> -<tr> -<td>init</td> -<td>beforeCreate</td> -<td>ç»ä»¶å®ä¾åå被å建ï¼ç»ä»¶å±æ§å¦data计ç®ä¹å</td> -</tr> -<tr> -<td>created</td> -<td>created</td> -<td>ç»ä»¶å®ä¾å建å®æï¼å±æ§å·²ç»å®ï¼ä½DOMè¿æªçæ</td> -</tr> -<tr> -<td></td> -<td>beforeMount</td> -<td>模æ¿ç¼è¯/æè½½ä¹å</td> -</tr> -<tr> -<td>ready</td> -<td>mounted</td> -<td>模æ¿ç¼è¯/æè½½ä¹å</td> -</tr> -<tr> -<td></td> -<td>beforeUpdate</td> -<td>ç»ä»¶æ´æ°ä¹å</td> -</tr> -<tr> -<td></td> -<td>updated</td> -<td>ç»ä»¶æ´æ°ä¹å</td> -</tr> -<tr> -<td></td> -<td>activated</td> -<td>for<code>keep-alive</code>, ç»ä»¶è¢«æ¿æ´»æ¶è°ç¨</td> -</tr> -<tr> -<td></td> -<td>deactivated</td> -<td>for<code>keep-alive</code>, ç»ä»¶è¢«ç§»é¤æ¶è°ç¨</td> -</tr> -<tr> -<td></td> -<td>beforeDestroy</td> -<td>ç»ä»¶è¢«éæ¯åè°ç¨</td> -</tr> -<tr> -<td>destroyed</td> -<td>destroyed</td> -<td>ç»ä»¶è¢«éæ¯åè°ç¨</td> -</tr> -</tbody> -</table> -<h1 id="Data-Binding-æ°æ®ç»å®"><a href="#Data-Binding-æ°æ®ç»å®" class="headerlink" title="Data Binding æ°æ®ç»å®"></a>Data Binding æ°æ®ç»å®</h1><p>å¨weexä¸ï¼ä½¿ç¨{{â¦}}å¨<code><template></code>ä¸ç»å®å¨<code><script></code>éå®ä¹çæ°æ®ï¼å¨vueä¸ï¼éè¦å¨è¦ç»å®çå±æ§åå <code>:</code> ãå¦ä»¥ä¸ç¤ºä¾ã</p> -<ul> -<li><p>ç±»å</p> -<ul> -<li>weex</li> -</ul> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">class</span>=<span class="string">"btn btn-{{type}}"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -<ul> -<li>vue</li> -</ul> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">:class</span>=<span class="string">"['btn', 'btn-' + type]"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p>æ ·å¼ç»å®</p> -<ul> -<li><p>weex</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">style</span>=<span class="string">"color:{{textColor}}"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p>vue</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">:style</span>=<span class="string">"{color: textColor}"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -</ul> -</li> -</ul> -<h1 id="ifæ令"><a href="#ifæ令" class="headerlink" title="ifæ令"></a>ifæ令</h1><ul> -<li><p>weex</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">image</span> <span class="attr">src</span>=<span class="string">"..."</span> <span class="attr">if</span>=<span class="string">"{{shown}}"</span>></span><span class="tag"></<span class="name">image</span>></span></div></pre></td></tr></table></figure> -<p>or</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">image</span> <span class="attr">src</span>=<span class="string">"..."</span> <span class="attr">if</span>=<span class="string">"shown"</span>></span><span class="tag"></<span class="name">image</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p>vue</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">image</span> <span class="attr">src</span>=<span class="string">"..."</span> <span class="attr">v-if</span>=<span class="string">"shown"</span>></span><span class="tag"></<span class="name">image</span>></span></div></pre></td></tr></table></figure> -</li> -</ul> -<h1 id="循ç¯æ令"><a href="#循ç¯æ令" class="headerlink" title="循ç¯æ令"></a>循ç¯æ令</h1><ul> -<li><p>weex: repeat</p> -<ul> -<li><p><code>$index</code>为索å¼</p> - <figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">repeat</span>=<span class="string">"{{list}}"</span>></span></div><div class="line"> <span class="tag"><<span class="name">text</span>></span>No. {{$index + 1}}<span class="tag"></<span class="name">text</span>></span></div><div class="line"><span class="tag"><<span class="name">div</span>></span></div></pre></td></tr></table></figure> -<p>or</p> - <figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">repeat</span>=<span class="string">"{{v in list}}"</span>></span></div><div class="line"> <span class="tag"><<span class="name">text</span>></span>No. {{$index + 1}}, {{v.nickname}}<span class="tag"></<span class="name">text</span>></span></div><div class="line"><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p>对象åæ°ç顺åº</p> - <figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">repeat</span>=<span class="string">"{{(key, value) in list}}"</span>></span></div><div class="line"> <span class="tag"><<span class="name">text</span>></span>No. {{key + 1}}, {{value.nickname}}<span class="tag"></<span class="name">text</span>></span></div><div class="line"><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p><code>track-by</code></p> - <figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">repeat</span>=<span class="string">"{{item in items}}"</span> <span class="attr">track-by</span>=<span class="string">"item.id"</span> <span class="attr">class</span>=<span class="string">"{{gender}}"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -</ul> -</li> -<li><p>vue: v-for</p> -<ul> -<li><p>移é¤<code>$index</code>ç´¢å¼</p> -</li> -<li><p>对象åæ°çæ¹åï¼æ¹ä¸º(value, key), ä¸éç¨ç对象è¿ä»£å¨ä¿æä¸è´</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">repeat</span>=<span class="string">"{{(value, key) in list}}"</span>></span></div><div class="line"> <span class="tag"><<span class="name">text</span>></span>No. {{key + 1}}, {{value.nickname}}<span class="tag"></<span class="name">text</span>></span></div><div class="line"><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p><code>track-by</code> æ¿æ¢ä¸º<code>v-bind</code></p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">v-for</span>=<span class="string">"item in items"</span> <span class="attr">v-bind:key</span>=<span class="string">"item.id"</span>></span></div></pre></td></tr></table></figure> -</li> -</ul> -</li> -</ul> -<h1 id="åå§åæ°æ®"><a href="#åå§åæ°æ®" class="headerlink" title="åå§åæ°æ®"></a>åå§åæ°æ®</h1><ul> -<li><p>weex</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line">data: { <span class="attr">value</span>: <span class="string">'x'</span> }</div></pre></td></tr></table></figure> -</li> -<li><p>vue</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line">props: { <span class="attr">value</span>: { <span class="attr">default</span>: <span class="string">'x'</span> } }</div></pre></td></tr></table></figure> -<p>å¨ææ°æ®</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line">data: <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{ <span class="keyword">return</span> { <span class="attr">value</span>: <span class="string">'x'</span> } }</div></pre></td></tr></table></figure> -</li> -</ul> -<h1 id="å´ç»DOMçå®ä¾æ¹æ³"><a href="#å´ç»DOMçå®ä¾æ¹æ³" class="headerlink" title="å´ç»DOMçå®ä¾æ¹æ³"></a>å´ç»DOMçå®ä¾æ¹æ³</h1><ul> -<li><p>è·åèç¹</p> -<ul> -<li><p>weex: <code>this.$el('xxx')</code></p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">template</span>></span></div><div class="line"> <span class="tag"><<span class="name">container</span>></span></div><div class="line"> <span class="tag"><<span class="name">text</span> <span class="attr">id</span>=<span class="string">"top"</span>></span>Top<span class="tag"></<span class="name">text</span>></span></div><div class="line"> <span class="tag"></<span class="name">container</span>></span></div><div class="line"><span class="tag"></<span class="name">template</span>></span></div><div class="line"><span class="tag"><<span class="name">script</span>></span><span class="javascript"></span></div><div class="line"><span class="built_in">module</span>.exports = {</div><div class="line"> <span class="attr">methods</span>: {</div><div class="line"> <span class="attr">toTop</span>: <span class="function">< span class="keyword">function</span> (<span class="params"></span>) </span>{</div><div class="line"> <span class="keyword">var</span> top = <span class="keyword">this</span>.$el(<span class="string">'top'</span>)</div><div class="line"> }</div><div class="line"> }</div><div class="line">}</div><div class="line"><span class="tag"></<span class="name">script</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p>vue</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line"><span class="keyword">this</span>.$refs.xxx</div></pre></td></tr></table></figure> -<p>â</p> -</li> -</ul> -</li> -</ul> -<h1 id="äºä»¶"><a href="#äºä»¶" class="headerlink" title="äºä»¶"></a>äºä»¶</h1><ul> -<li><p>äºä»¶ç»å®</p> -<ul> -<li><p>weex</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> <span class="attr">onclick</span>=<span class="string">"handler"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -<li><p>vue</p> -<figure class="highlight html"><table><tr><td class="code"><pre><div class="line"><span class="tag"><<span class="name">div</span> @<span class="attr">click</span>=<span class="string">"handler"</span>></span><span class="tag"></<span class="name">div</span>></span></div></pre></td></tr></table></figure> -</li> -</ul> -</li> -<li><p>äºä»¶è§¦å</p> -<ul> -<li><p>weex: dispatchåbroadcast</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line"><span class="keyword">this</span>.$dispatch()</div></pre></td></tr></table></figure> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line"><span class="keyword">this</span>.$broadcast()</div></pre></td></tr></table></figure> -</li> -<li><p>vue: emit</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line"><span class="keyword">this</span>.$emit()</div></pre></td></tr></table></figure> -</li> -</ul> -<blockquote> -<p>注ï¼Weex ç <code>$dispatch</code> ä¸ç»ä»¶æ å ³ï¼å¨ä»»æç»ä»¶ä¸é½å¯ä»¥éè¿ <code>$on</code> æè·å°ï¼Vue ç<code>$emit</code> ç¨äºè§¦åç»ä»¶(æ ç¾)çèªå®ä¹äºä»¶ã</p> -</blockquote> -</li> -<li><p>åçäºä»¶</p> -<ul> -<li><p>weex</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line">onclick=<span class="string">"xxx"</span></div></pre></td></tr></table></figure> -</li> -<li><p>vue</p> -<figure class="highlight javascript"><table><tr><td class="code"><pre><div class="line">@click.native=<span class="string">"xxx"</span></div></pre></td></tr></table></figure> -</li> -</ul> -</li> -</ul> - - </div> - -</article> -</div> - - <footer id="footer"> - <div class="row clearfix"> - <div class="dropdown select-lang"> - <a href="javascript:;" class="dropdown-toggle"> - Language - <span class="caret"></span> - </a> - <ul class="dropdown-menu pick-lang"> - <li> - <a href="/references/migration/difference.html" data-lang="en">English</a> - </li> - <li> - <a href="/cn/references/migration/difference.html" data-lang="zh-cn">ä¸æ</a> - </li> - </ul> - </div> - </div> - <div class="disclaimer"> - <div><img src="//gw.alicdn.com/tfs/TB1pTBZQFXXXXX9XXXXXXXXXXXX-794-280.png" width="200px" alt="Apache Incubator"></div> - <div><span class="title">Disclaimer:</span> Apache Weex is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</div> - <br/> - </div> - <hr> - <div class="row"> - <p> <img src="//gw.alicdn.com/tfs/TB1bg8SQFXXXXcHXXXXXXXXXXXX-85-170.png" height="50px" alt="Apache"><span>Copyright(c) 2017 The Apache Software Foundation. Licensed under the </span> <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a></p> - </div> - <div class="row clearfix"> - <div></div> - </div> -</footer> - <div style="display: none;"> - <script src="//s95.cnzz.com/z_stat.php?id=1261496509&web_id=1261496509" language="JavaScript"></script> -</div> - - <script src="/js/reqwest.js"></script> - <script src="/js/common.js"></script> -</body> -</html>