From d1a568e3714fa1ac82c97bc71640a0442e02c94c Mon Sep 17 00:00:00 2001 From: neil_tsai Date: Thu, 27 May 2021 15:30:27 +0800 Subject: Getting started with Svelte (zh-TW translation) (part of "Following this tutorial") with "Using the Svelte REPL" segment --- .../svelte_getting_started/index.html | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'files/zh-tw/learn/tools_and_testing') 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 73b552e046..b66c784a10 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 @@ -413,44 +413,44 @@ npm run dev

注意:假如你只是想要下載檔案而不是複製git儲存庫,你可以使用degit工具像是這樣——npx degit opensas/mdn-svelte-tutorial。你也可以用npx degit opensas/mdn-svelte-tutorial/01-getting-started來下載特定資料夾。Degit將不會建立本地git儲存庫,它將只下載特定資料夾下的檔案們。

-

Using the Svelte REPL

+

使用Svelte REPL

-

A REPL (read–eval–print loop) is an interactive environment that allows you to enter commands and immediately see the results — many programming languages provide a REPL.

+

REPL(read–eval–print loop)是一個互動式環境,允許你輸入一些指令並能立即看到結果——大部分的程式語言都有提供REPL。

-

Svelte's REPL is much more than that. It's an online tool that allows you to create complete apps, save them online, and share with others.

+

Svelte的REPL功能卻不只如此。它是一個線上工具,允許你建構一個完整的應用程式並儲存它們於線上,也能分享給其他人。

-

It's the easiest way to start playing with Svelte from any machine, without having to install anything. It is also widely used by Svelte community. If you want to share an idea, ask for help, or report an issue, it's always extremely useful to create a REPL instance demomstrating the issue.

+

它是最簡單可以在任何機器上開始體驗Svelte的方式,而不需要安裝任何東西。它也廣泛地被Svelte社群所使用。假如你想要分享一些想法、尋求幫助或回報問題,建立一個 REPL 來演示問題總是有幫助的。

-

Let's have a quick look at the Svelte REPL and how you'd use it. It looks like so:

+

讓我們快速看一下Svelte REPL和你應該怎麼去使用它。它看起來像:

the svelte repl in action, showing component code on the left, and output on the right

-

To start a REPL, open your browser and navigate to https://svelte.dev/repl.

+

為了開始使用REPL,打開你的瀏覽器並至https://svelte.dev/repl

-

Whenever you change any file on the REPL, Svelte will recompile the app and update the Result tab. To share your app share the url. For example, here's the link for a REPL running our complete app: https://svelte.dev/repl/378dd79e0dfe4486a8f10823f3813190?version=3.23.2.

+

每當你在REPL改變任何檔案,Svelte將會重新編譯應用程式並更新結果(Result)標籤。為了分享你的應用程式網址。舉個例子,這是運行我們完整應用程式的REPL連結:https://svelte.dev/repl/378dd79e0dfe4486a8f10823f3813190?version=3.23.2

-

Note: Notice how you can specify Svelte's version in the URL. This is useful when reporting issues related to a specific version of Svelte.

+

注意:可以注意一下在連結上怎麼標註Svelte的版本。當你在回報Svelte特定版本的問題時,這是很有幫助的。

-

We will provide a REPL at the beginning and end of each article so that you can start coding with us right away.

+

我們將會在每一篇文章的開頭與結尾提供REPL,所以你就能立刻和我們一起撰寫程式碼。

-

Note: at the moment the REPL can't handle folder names properly. If you are following the tutorial on the REPL, just create all your components inside the root folder. Then when you see a path in the code, for example import Todos from './components/Todos.svelte', just replace it with a flat URL, e.g. import Todos from './Todos.svelte'.

+

注意:不知何時REPL變得沒辦法適當地處理資料夾名稱。假如你是使用REPL來跟著教學系列,只需要將所有你的元件建立在根目錄即可。接著當你看到程式碼中的路徑時,舉例來說如果是import Todos from './components/Todos.svelte',只需要將它換成類似如import Todos from './Todos.svelte'即可。

The code so far

-- cgit v1.2.3-54-g00ecf