# 混合耦合的与解耦的逻辑

即使启用，解耦的模板逻辑也不是必须的。启用时，引擎会寻找包含解耦的逻辑的资源。如果它存在，就会解析它，并把它和原始的模板合并。如果解耦的逻辑资源不存在，不会抛出错误。

并且，在同一个模板里，我们可以混合耦合的与解耦的逻辑。比如，将一些Thymeleaf属性添加到原始的模板文件，而把另一些留在独立的解耦的逻辑文件里。最通常的情况是使用新的（v3.0）`th:ref`属性。


---

# Agent Instructions: 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:

```
GET https://jack80342.gitbook.io/thymeleaf/i.-using-thymeleaf/17-jie-ou-de-mo-ban-luo-ji/17.2-pei-zhi-jie-ou-de-mo-ban/mixing-coupled-and-decoupled-logic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
