> For the complete documentation index, see [llms.txt](https://fui-docs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fui-docs.gitbook.io/docs/du-an-va-module/them-ma-nguon.md).

# Thêm mã nguồn

Đôi khi xây dựng module với những tính năng không được tích hợp sẵn thì việc sử dùng thêm mã nguồn hoặc thư viện Javascript là điều cần thiết để xây dựng các tính năng đặc biệt.

Để thêm một mã nguồn vào dự án (việc này có nghĩa là mã nguồn sẽ áp dụng cho toàn bộ dự án, tất cả các module trong dự án đều có thể gọi, tham chiếu đến mã nguồn này), chọn <img src="/files/lw3Sgh08IDPeXlDIN3qv" alt="" data-size="line"> bên góc phải màn hình (thêm mã nguồn vào từng module cũng vậy, bấm vào tab Import bên trái màn hình UI Editor), tiếp theo chọn <img src="/files/9MGsD3dqqbwd24i1tfAk" alt="" data-size="line">, điền các thông tin vào form như dưới đây, sau đó bấm Thêm mới để hoàn thành:

<figure><img src="/files/DUZDQ8WlpsTBYSlMV2SC" alt=""><figcaption></figcaption></figure>

**Chú giải:**

* **Sort:** Thứ tự ưu tiên của mã nguồn trong module
* **File Name:** Tên file mã nguồn hoặc địa chỉ của mã nguồn.
* **File Type:** Phụ thuộc vào File Name, nếu giá trị của File Name là một địa chỉ mã nguồn thì File Type sẽ là **link** và địa chỉ của mã nguồn sẽ được thêm vào module khi tải tran&#x67;**,** nếu chọn File Type là **js** hoặc **css** thì một file js hoặc css sẽ được tạo ra để chúng ta có thể viết mã bên trong đó.

{% hint style="info" %}
Đối với **comp-link** là những thư viện, script, css đã được tích hợp sẵn trong FUI và được sử dụng bởi các **Fast Component** (các component có tiền tố là 'f-\*', ví dụ: 'f-date', 'f-button', 'f-time',...) nên không cần phải tạo mới.

Trong trường hợp này, sau khi đã khởi tạo control là F*ast Component* xong, bạn có thể tải trang và phát hiện lỗi ở tab Console trình duyệt (thường là lỗi \[cái gì đó] is not defined), hãy chuyển sang phần Import của module "mà bạn đang xây dựng" (nhớ là module nhé, vì bạn có thể nhầm lẫn giữa import project và module), ở giao diện import này hãy bấm vào nút <img src="/files/KBVqYqcNNHzJnzKw0THv" alt="" data-size="line"> để FUI cập nhật các thư viện mà module cần dùng.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fui-docs.gitbook.io/docs/du-an-va-module/them-ma-nguon.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
