From 6aa5a993570489d478842a3b8a2b3625e3af4fe9 Mon Sep 17 00:00:00 2001 From: neil_tsai Date: Tue, 4 May 2021 16:09:50 +0800 Subject: Getting started with Svelte (zh-TW translation) (part of "First steps with Svelte") with "Creating your first Svelte app" & "Application structure" segment --- .../svelte_getting_started/index.html | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/files/zh-tw/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.html b/files/zh-tw/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.html index ddc11c24aa..ec9f92c8ce 100644 --- a/files/zh-tw/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.html +++ b/files/zh-tw/learn/tools_and_testing/client-side_javascript_frameworks/svelte_getting_started/index.html @@ -91,16 +91,16 @@ tags:

若想知道更多相關資訊也可以至下列去閱讀:

-

Creating your first Svelte app

+

建構你第一個 Svelte 應用程式

-

The easiest way to create a starter app template is to just download the starter template application. You can do that by visiting sveltejs/template on GitHub or you can avoid having to download and unzip it and just use degit.

+

最簡單的方式就是使用入門範本來建構初始應用程式。你可以至 sveltejs/template 下載並解壓縮出入門範本或者使用 degit 來做這件事。

-

To create your starter app template, run the following terminal commands:

+

為了建構你第一個入門範本應用程式,請先執行下列終端機指令:

npx degit sveltejs/template moz-todo-svelte
 cd moz-todo-svelte
@@ -108,16 +108,16 @@ npm install
 npm run dev
-

Note: degit doesn't do any kind of magic — it just lets you download and unzip the latest version of a git repo's contents. This is much quicker than using git clone because it will not download all the history of the repo, or create a complete local clone.

+

注意:不用太驚訝 degit 做了這麼多事情 — 它其實就只是讓你可以從 git 儲存庫下載和解壓縮最新版本的內容。使用它比起使用 git clone 更快能達到我們的目的,因為它並不會下載整個儲存庫的歷史以及不會複製一份放在本機端。

-

After running npm run dev, Svelte will compile and build your application. It will start a local server at localhost:5000. Svelte will watch for file updates, and automatically recompile and refresh the app for you when changes are made to the source files. Your browser will display something like this:

+

之後執行 npm run dev,Svelte 將會編譯和建構你的應用程式。它將會跑在本機 localhost:5000 位址。當你對來源檔案做了異動,Svelte 將會偵測到檔案更新並自動地重新編譯和刷新你的應用程式。你的瀏覽器將會顯示如下圖:

A simple start page that says hello world, and gives a link to the official svelte tutorials

-

Application structure

+

應用程式結構

-

The starter template comes with the following structure:

+

入門範本有下列結構:

moz-todo-svelte
 ├── readme.md
@@ -139,29 +139,29 @@ npm run dev
├── App.svelte └── main.js -

The contents are as follows:

+

內容解釋如下: