From 42e37e4fd5a641d33058901743491a6a79a39642 Mon Sep 17 00:00:00 2001 From: cdcd72 Date: Wed, 26 May 2021 22:14:31 +0800 Subject: Getting started with Svelte (zh-TW translation) (part of "A look under the hood") --- .../svelte_getting_started/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'files/zh-tw') 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 455ab379f7..34da854ecf 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 @@ -350,15 +350,15 @@ export default app;
  • props:指定數值給App元件中的每一個屬性。
  • -

    A look under the hood

    +

    葫蘆裡賣什麼藥?

    -

    How does Svelte manage to make all these files work together nicely?

    +

    Svelte是如何很好地讓所有檔案協同工作?

    -

    The Svelte compiler processes the <style> section of every component and compiles them into the public/build/bundle.css file.

    +

    Svelte編譯器處理每一個元件的<style>區塊並編譯它們至public/build/bundle.css檔案中。

    -

    It also compiles the markup and <script> section of every component and stores the result in public/build/bundle.js. It also adds the code in src/main.js to reference the features of each component.

    +

    它也編譯每一個元件的標記和<script>區塊並把結果儲存至public/build/bundle.js。它也會加上一些程式碼到src/main.js以參考每一個元件的功能。

    -

    Finally the file public/index.html includes the generated bundle.css and bundle.js files:

    +

    最後public/index.html檔案會引入那些被產生的bundle.cssbundle.js檔案:

    <!DOCTYPE html>
     <html lang="en">
    @@ -379,9 +379,9 @@ export default app;
    </body> </html> -

    The minified version of bundle.js weighs a little more than 3KB, which includes the "Svelte runtime" (just 300 lines of JavaScript code) and the App.svelte compiled component. As you can see, bundle.js is the only JavaScript file referenced by index.html. There are no other libraries loaded into the web page.

    +

    bundle.js的壓縮版本容量大概3KB多一點,其中包含「Svelte執行環境」(約300行JavaScript程式碼)和被編譯後的App.svelte元件。你可以看到,bundle.js是唯一一個被index.html參考的JavaScript檔案。沒有其它函式庫被載入至網頁中。

    -

    This is a much smaller footprint than compiled bundles from other frameworks. Take into account that, in the case of code bundles, it's not just the size of the files you have to download that matter. This is executable code that needs to be parsed, executed, and kept in memory. So this really makes a difference, especially in low-powered devices or CPU-intensive applications.

    +

    比起其它框架編譯後的bundles要小的多。考慮到程式碼bundles這件事,不僅僅是你需下載檔案的大小。包含那些需要被解析、執行並保存於記憶體中的可執行程式碼。所以確實有蠻大的不同,特別是低功耗裝置或CPU密集型應用程式。

    Following this tutorial

    -- cgit v1.2.3-54-g00ecf