
- Sencha Touch 教程
- Sencha Touch - 首頁
- Sencha Touch - 概述
- Sencha Touch - 環境
- Sencha Touch - 命名規範
- Sencha Touch - 架構
- Sencha Touch - MVC 解釋
- Sencha Touch - 第一個應用
- Sencha Touch - 構建應用
- Sencha Touch - 遷移步驟
- Sencha Touch - 核心概念
- Sencha Touch - 資料
- Sencha Touch - 主題
- Sencha Touch - 裝置配置檔案
- Sencha Touch - 依賴項
- 環境檢測
- Sencha Touch - 事件
- Sencha Touch - 佈局
- Sencha Touch - 歷史與支援
- Sencha Touch - 上傳與下載
- Sencha Touch - 檢視元件
- Sencha Touch - 打包
- Sencha Touch - 最佳實踐
- Sencha Touch 有用資源
- Sencha Touch - 快速指南
- Sencha Touch - 有用資源
- Sencha Touch - 討論
Sencha Touch - 環境
本地環境設定
本節指導您如何在您的機器上下載和設定 Sencha Touch。請按照步驟設定環境。
下載庫檔案
從以下連結下載 Sencha Touch 庫檔案的商業版本 https://www.sencha.com。您將在您的註冊郵箱中收到試用版,這是一個名為 sencha-touch-2.4.2-commercial 的壓縮資料夾。
解壓資料夾,您將找到各種 JavaScript 和 CSS 檔案,可以包含在您的應用程式中。主要包含以下檔案:
JavaScript 檔案 - 您可以在 \sencha-touch-2.4.2-commercial\touch-2.4.2 資料夾下找到的 JS 檔案:
序號 | 檔案及描述 |
---|---|
1 | sencha-touch.js 這是包含執行應用程式所有功能的核心檔案。 |
2 | sencha-touch-all.js 此檔案包含所有已壓縮的程式碼,檔案中沒有註釋。 |
3 | sencha-touch-debug.js 這是 sencha-touch-all.js 的未壓縮版本,用於除錯。 |
4 | sencha-touch-all-debug.js 此檔案也是未壓縮的,用於開發目的,因為它包含所有註釋和控制檯日誌,用於檢查任何錯誤/問題。 |
您可以將這些檔案新增到專案的 JS 資料夾中,也可以提供系統中檔案所在的直接路徑。
CSS 檔案 - 您可以在 I:\sencha touch\sencha-touch-2.4.2-commercial\touch-2.4.2\resources\css\sencha-touch.css 資料夾下找到許多基於主題的檔案
這些庫檔案將在 Sencha Touch 應用程式中新增如下:
<html> <head> <script type = "text/javascript" src = "../sencha-touch-2.4.2-commercial/touch-2.4.2/sencha-touch-all.js"></script> <link href = "../sencha-touch-2.4.2-commercial/touch-2.4.2/resources/css/sencha-touch.css" rel = "stylesheet" /> <script type ="text/javascript" src = "app.js" > </script> </head> </html>
您可以將 Sencha Touch 應用程式程式碼儲存在 app.js 檔案中。
CDN 設定
CDN 是內容分發網路,使用它您無需下載 Sencha Touch 庫檔案,而可以直接將 ExtJS 的 CDN 連結新增到您的程式中,如下所示:
<html> <head> <script type = "text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script> <link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css" rel="stylesheet" /> <script type = "text/javascript" src = "app.js" > </script> </head> </html>
常用編輯器
因為它是一個用於開發 Web 應用程式的 JavaScript 框架,所以專案將包含 HTML、JS 檔案,要編寫您的 Ext JS 程式,您將需要一個文字編輯器。市場上有許多 IDE 可用。但目前,您可以考慮以下其中一種:
記事本 - 在 Windows 機器上,您可以使用任何簡單的文字編輯器,例如記事本(本教程推薦)、Notepad++。
Brackets - 另一個流行的 IDE,可以從 http://brackets.io/ 下載。
Sublime - 另一個流行的 IDE,可以從 https://www.sublimetext.com/3/ 下載。