From acb64532ab0d653088387be042a54aaeaddc320f Mon Sep 17 00:00:00 2001
From: Phan An
Date: Sat, 19 Feb 2022 22:27:41 +0700
Subject: [PATCH 01/11] docs: translate src/guide/essentials/application.md
---
.gitignore | 3 ++
src/guide/essentials/application.md | 54 ++++++++++++++---------------
2 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/.gitignore b/.gitignore
index b4a9415240..ea50b40700 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,9 @@ Network Trash Folder
Temporary Items
.apdisk
+# IDE, editors
+.idea/
+
### Node ###
# Logs
logs
diff --git a/src/guide/essentials/application.md b/src/guide/essentials/application.md
index b587209e47..8b3f42297f 100644
--- a/src/guide/essentials/application.md
+++ b/src/guide/essentials/application.md
@@ -1,35 +1,35 @@
-# Creating a Vue Application
+# Tạo ứng dụng Vue
-## The application instance
+## Application instance
-Every Vue application starts by creating a new **application instance** with the [`createApp`](/api/application#createapp) function:
+Mội ứng dụng Vue được khởi động bằng cách tạo một **application instance** (thực thể của ứng dụng, từ đây ta cũng gọi tắt là "app instance") với hàm [`createApp`](/api/application#createapp):
```js
import { createApp } from 'vue'
const app = createApp({
- /* root component options */
+ /* tùy chọn cho component gốc */
})
```
-## The Root Component
+## Component gốc
-The object we are passing into `createApp` is in fact a component. Every app requires a "root component" that can contain other components as its children.
+Object mà ta đưa vào hàm `createApp` trên đây thực ra là một _component_. Mỗi app Vue yêu cầu một "component gốc," component này có thể chứa các component con khác.
-If you are using Single-File Components, we typically import the root component from another file:
+Nếu sử dụng Single-File Component, thường thì ta import component gốc từ một file khác:
```js
import { createApp } from 'vue'
-// import the root component App from a single-file component.
+// import component gốc "App" từ một single-file component
import App from './App.vue'
const app = createApp(App)
```
-While many examples in this guide only need a single component, most real applications are organized into a tree of nested, reusable components. For example, a Todo application's component tree might look like this:
+Tuy đa số các ví dụ trong hướng dẫn này chỉ cần một component, các app trong thực tế thường được sắp xếp thành một cây component lồng nhau và có thể tái sử dụng. Đơn cử, cây component của một app Todo có thể có dạng như sau:
```
-App (root component)
+App (component gốc)
├─ TodoList
│ └─ TodoItem
│ ├─ TodoDeleteButton
@@ -39,11 +39,11 @@ App (root component)
└─ TodoStatistics
```
-We will discuss how to define and compose multiple components together in later sections of the guide. Before that, we will focus on what happens inside a single component.
+Trong các phần sau của hướng dẫn, chúng ta sẽ bàn về cách định nghĩa và soạn thảo nhiều component cùng lúc. Nhưng trước tiên, chúng ta sẽ tập trung vào những gì xảy ra bên trong một component đơn lẻ.
-## Mounting the App
+## Mount một app
-An application instance won't render anything until its `.mount()` method is called. It expects a "container" argument, which can either be an actual DOM element or a selector string:
+Một app instance sẽ không render ra gì hết cho đến khi phương thức `.mount()` của nó được gọi. Phương thức này nhận vào một tham số "container," là một phần tử DOM hoặc một selector:
```html
@@ -53,13 +53,13 @@ An application instance won't render anything until its `.mount()` method is cal
app.mount('#app')
```
-The content of the app's root component will be rendered inside the container element. The container element itself is not considered part of the app.
+Nội dung của component gốc của một ứng dụng sẽ được render bên trong phần tử container. Phần tử container không được xem là một phần của app.
-The `.mount()` method should always be called after all app configurations and asset registrations are done. Also note that its return value, unlike the asset registration methods, is the root component instance instead of the application instance.
+Bạn nên gọi phương thức `.mount()` sau khi cài đặt toàn bộ cấu hình và đăng kí các asset. Đồng thời, lưu ý rằng giá trị trả về của nó, không giống như các phương thức đăng kí asset, là một instance của component gốc thay vì của app.
-### In-DOM Root Component Template
+### Template cho component gốc trong DOM
-When using Vue without a build step, we can write our root component's template directly inside the mount container:
+Khi sử dụng Vue mà không thông qua bước build, chúng ta có thể viết trực tiếp template (bản mẫu) cho component gốc bên trong container được mount:
```html
- The
- Progressive
- JavaScript Framework
+ Framework JavaScript
+
+ Linh Động
- An approachable, performant and versatile framework for building web
- user interfaces.
+ Một framework gần gũi, mạnh mẽ và linh hoạt để xây đụng giao diện web.
- Thật sự reactive, trình biên được tối ưu để render hệ thống mà hiếm khi cần tới tối ưu hóa thủ công.
+ Thật sự reactive, trình biên dịch được tối ưu để render hệ thống mà hiếm khi cần tới tối ưu hóa thủ công.
Đa năng
- Một hệ sinh thái linh hoạt với cách thành phần từ cư bản đến nâng cao, từ một thư viện đơn giản đến một framework đầy đủ tính năng.
+ Một hệ sinh thái linh hoạt với các thành phần từ cơ bản đến nâng cao, từ một thư viện đơn giản đến một framework đầy đủ tính năng.
- Một framework gần gũi, mạnh mẽ và linh hoạt để xây đụng giao diện web.
+ Một framework gần gũi, mạnh mẽ và linh hoạt để xây dựng giao diện người dùng web.
- Xây dựng dựa trên HTML, CSS và JavaScript tiêu chuẩn với API trực quan và tài liệu tốt nhất.
-
+
Xây dựng dựa trên HTML, CSS và JavaScript, với API trực quan và tài liệu đẳng cấp thế giới.
Mạnh mẽ
-
- Thật sự reactive, trình biên dịch được tối ưu để render hệ thống mà hiếm khi cần tới tối ưu hóa thủ công.
-
+
Hệ thống render hoàn toàn reactive và được tối ưu hóa từ bước biên dịch, hiếm khi cần đến tối ưu thủ công.
-
Đa năng
-
- Một hệ sinh thái linh hoạt với các thành phần từ cơ bản đến nâng cao, từ một thư viện đơn giản đến một framework đầy đủ tính năng.
-
+
Linh hoạt
+
Một hệ sinh thái phong phú từ cơ bản đến nâng cao, từ một thư viện đơn giản đến một framework đầy đủ tính năng.
From e4e0f52130f62462a0c697319e7e03364df7ad5b Mon Sep 17 00:00:00 2001
From: 8BU <23427728+8bu@users.noreply.github.com>
Date: Tue, 22 Feb 2022 16:26:46 +0700
Subject: [PATCH 07/11] docs: translate page src/guide/quick-start.md (#15)
Co-authored-by: Phan An
---
src/guide/quick-start.md | 82 ++++++++++++++++++++--------------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/src/guide/quick-start.md b/src/guide/quick-start.md
index a6545752d5..934ee1a698 100644
--- a/src/guide/quick-start.md
+++ b/src/guide/quick-start.md
@@ -2,31 +2,31 @@
footer: false
---
-# Quick Start
+# Bắt đầu nhanh
-Depending on your use case and preference, you can use Vue with or without a build step.
+Tùy từng trường hợp hay sở thích, bạn có thể dùng Vue với bước build hoặc không.
-## With Build Tools
+## Với các công cụ build
-A build setup allows us to use Vue [Single-File Components](/guide/scaling-up/sfc) (SFCs). The official Vue build setup is based on [Vite](https://vitejs.dev), a frontend build tool that is modern, lightweight and extremely fast.
+Công cụ build cho phép chúng ta sử dụng [Single-File Component](/guide/scaling-up/sfc) (SFC). Công cụ build chính thức của Vue được dựa trên [Vite](https://vitejs.dev), một công cụ build frontend hiện đại, nhẹ nhàng và cực kỳ nhanh.
-### Online
+### Trực tuyến (Online)
-You can try Vue with SFCs online on [StackBlitz](https://vite.new/vue). StackBlitz runs the Vite-based build setup directly in the browser, so it is almost identical to the local setup but doesn't require installing anything on your machine.
+Bạn có thể dùng thử Vue với SFC trực tuyến trên [StackBlitz](https://vite.new/vue). StackBlitz sử dụng Vite để build trực tiếp trên trình duyệt, nên nó gần như giống hệt với thiết lập cục bộ (local) trên máy bạn, nhưng không cần cài đặt thêm bất cứ thứ gì.
-### Local
+### Cục bộ (Local)
-:::tip Pre-requisites
+:::tip Điều kiện tiên quyết
-- Familiarity with the command line
-- Install [Node.js](https://nodejs.org/)
+- Quen thuộc với giao diện dòng lệnh
+- Cài đặt [Node.js](https://nodejs.org/)
:::
-To create a build-tool-enabled Vue project on your machine, run the following command in your command line (without the `>` sign):
+Để tạo một dự án Vue với công cụ build trên máy tính của bạn, hãy chạy dòng lệnh sau (không có dấu `>`)
>npm init vue@latest
-This command will install and execute [create-vue](https://github.com/vuejs/create-vue), the official Vue project scaffolding tool. You will be presented with prompts for a number of optional features such as TypeScript and testing support:
+Dòng lệnh trên sẽ cài đặt và thực thi [create-vue](https://github.com/vuejs/create-vue), công cụ tạo lập dự án mẫu chính thức của Vue. Giao diện dòng lệnh lúc này sẽ yêu cầu bạn lựa chọn các tính năng cho dự án như TypeScript hoặc hỗ trợ kiểm thử (testing):
✔Project name: … <your-project-name>✔Add TypeScript? … No / Yes
@@ -41,32 +41,32 @@ This command will install and execute [create-vue](https://github.com/vuejs/crea
Scaffolding project in ./<your-project-name>...Done.
-If you are unsure about an option, simply choose `No` by hitting enter for now. Once the project is created, follow the instructions to install dependencies and start the dev server:
+Nếu như bạn không chắc chắn về các lựa chọn này, tạm thời cứ chọn `No` bằng cách ấn phím Enter. Khi dự án đã được khởi tạo, hãy gõ theo những dòng lệnh hướng dẫn xuất hiện trên màn hình và khởi chạy dev server:
> cd<your-project-name>> npm install> npm run dev
-You should now have your first Vue project running! Here are some additional tips:
+Vạy là bạn đã khởi chạy được dự án Vue đầu tiên! Sau đây là một số lời khuyên:
-- The recommended IDE setup is [Visual Studio Code](https://code.visualstudio.com/) + [Volar extension](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar). [WebStorm](https://www.jetbrains.com/webstorm/) is also viable.
-- More tooling details, including integration with backend frameworks, are discussed in the [Tooling Guide](/guide/scaling-up/tooling.html).
-- To learn more about the underlying build tool Vite, check out the [Vite docs](https://vitejs.dev).
-- If you chose to use TypeScript, check out the [TypeScript Usage Guide](typescript/overview.html).
+- Thiết lập IDE khuyến nghị là [Visual Studio Code](https://code.visualstudio.com/) + [Volar extension](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar). Bạn cũng có thể dùng [WebStorm](https://www.jetbrains.com/webstorm/).
+- Chi tiết hơn về các công cụ, bao gồm cả tích hợp với các backend framework, sẽ được thảo luận trong phần [Hướng dẫn về công cụ](/guide/scaling-up/tooling.html).
+- Để biết thêm về Vite, hãy đọc [tài liệu của Vite](https://vitejs.dev).
+- Nếu bạn dùng TypeScript, xem thêm phần [Hướng dẫn sử dụng TypeScript](typescript/overview.html).
-When you are ready to ship your app to production, run the following:
+Khi đã sẵn sàng đưa app lên môi trường production, chạy dòng lệnh sau:
> npm run build
-This will create a production-ready build of your app in the project's `./dist` directory. Check out the [Production Deployment Guide](/guide/best-practices/production-deployment.html) to learn more about shipping your app to production.
+Lệnh này sẽ khởi tạo một bản build production cho app của bạn trong thư mục `./dist` của dự án. Xem phần [Hướng dẫn triển khai Production](/guide/best-practices/production-deployment.html) để tìm hiểu thêm về cách đưa dự án của bạn lên production.
-[Next Steps >](#next-steps)
+[Bước tiếp theo >](#next-steps)
-## Without Build Tools
+## Không sử dụng công cụ build
-To get started with Vue without a build step, simply copy the following code into an HTML file and open it in your browser:
+Để khởi tạo dự án Vue mà không có bước build, hãy sao chép đoạn mã sau vào một file HTML và mở file này trong trình duyệt:
```html
@@ -84,9 +84,9 @@ To get started with Vue without a build step, simply copy the following code int
```
-The above example uses the global build of Vue where all APIs are exposed under the global `Vue` variable.
+Ví dụ trên sử dụng bản build global của Vue, với toàn bộ API có sẵn (exposed) trong biến toàn cục `Vue`.
-While the global build works, we will be primarily using [ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) syntax throughout the rest of the documentation for consistency. In order to use Vue over native ES modules, use the following HTML instead:
+Tuy hoàn toàn có thể dùng bản build global của Vue, trong suốt phần còn lại của tài liệu này chúng ta chủ yếu sẽ sử dụng cú pháp [ES module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) cho nhất quán. Để sử dụng Vue với ES module, hãy dùng đoạn HTML sau:
```html
```
-Notice how we can import directly from `'vue'` in our code - this is made possible by the `
```
-Now when you run `fullName.value = 'John Doe'`, the setter will be invoked and `firstName` and `lastName` will be updated accordingly.
+Giờ khi bạn chạy `fullName.value = 'John Doe'`, setter sẽ được gọi rồi `firstName` vả `lastName` sẽ được cập nhật tương ứng.
-## Best Practices
+## Lời khuyên khi dùng thuộc tính computed
-### Getters should be side-effect free
+### Getter không nên có hiệu ứng phụ
-It is important to remember that computed getter functions should only perform pure computation and be free of side effects. For example, don't make async requests or mutate the DOM inside a computed getter! Think of a computed property as declaratively describing how to derive a value based on other values - its only responsibility should be computing and returning that value. Later in the guide we will discuss how we can perform side effects in reaction to state changes with [watchers](./watchers).
+Điều quan trọng cần phải nhớ là hàm getter chỉ nên thực hiện duy nhất một việc tính toán đơn thuần và không có hiệu ứng phụ. Ví dụ, đừng tạo một request đồng bộ hoặc thay đổi DOM bên trong một hàm getter! Hãy xem thuộc tính computed như một khai báo về cách để lấy giá trị dựa trên những giá trị khác – nó chỉ có trách nhiệm tính toán và trả về giá trị đó mà thôi. Ở phần sau của hướng dẫn, chúng ta sẽ thảo luận về cách để thực hiện một hiệu ứng phụ dựa trên sự thay đổi của state bằng [watcher](./watchers).
-### Avoid mutating computed value
+### Tránh thay đổi các giá trị đã tính
-The returned value from a computed property is derived state. Think of it as a temporary snapshot - every time the source state changes, a new snapshot is created. It does not make sense to mutate a snapshot, so a computed return value should be treated as read-only and never be mutated - instead, update the source state it depends on to trigger new computations.
+Giá trị được trả về từ một thuộc tính computed là trạng thái được suy luận ra. Hãy xem nó như một snapshot (ảnh chụp) tạm thời – mỗi khi các trạng thái mà nó phụ thuộc bị thay đổi, thì một snapshot mới được tạo ra. Việc thay đổi một snapshot là không hợp lý, vậy một giá trị được trả về bởi computed nên được xem là chỉ đọc và không bao giờ bị thay đổi – thay vào đó, hãy cập nhật trạng thái mà nó phụ thuộc để kích hoạt những tính toán mới.
From d629e3adf93b640378ccd494e6eb314339972894 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Phan=20H=E1=BB=93ng=20Nam?=
Date: Thu, 28 Apr 2022 15:58:43 +0700
Subject: [PATCH 11/11] docs: translate file
src/guide/essentials/conditional.md (#19)
---
src/guide/essentials/conditional.md | 42 ++++++++++++++---------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/guide/essentials/conditional.md b/src/guide/essentials/conditional.md
index 8f70c3c271..0783d32356 100644
--- a/src/guide/essentials/conditional.md
+++ b/src/guide/essentials/conditional.md
@@ -1,4 +1,4 @@
-# Conditional Rendering
+# Render theo điều kiện