Weex 學習教程


一、環境搭建

1.安裝Node,官網下載(http://nodejs.org/

2.查看npm安裝版本,終端輸入:npm -v版本不能低於2.15.1

3.安裝weex-toolkit,終端輸入:npm install -g weex-toolkit

至此,環境已經搭建完成;

二、使用

1.使用H5編輯器,寫入以下內容:

<template>
  <div class="container">
    <div class="cell">
        <image class="thumb" src="http://t.cn/RGE3AJt"></image>
        <text class="title">JavaScript</text>
    </div>
  </div>
</template>

<style>
  .cell { margin-top: 10; margin-left: 10; flex-direction: row; }
  .thumb { width: 200; height: 200; }
  .title { text-align: center; flex: 1; color: grey; font-size: 50; }
</style>

另存為test.we,進入文件所在目錄,在終端輸入:wexx test.we;操作完成后會打開瀏覽器,進入到這個頁面,在test.we所在的文件目錄會生成weex_tmp文件夾,在weex_tmp\h5_render目錄下是生成的react.js

 2.將生成的js文件拷貝到Weex項目的assert目錄中就即可按照自己的方式使用了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM