# 如何重写 gjs 组件中的模板

**URL:** https://meta.discourse.org/t/gjs-template/406094
**Category:** Support
**Created:** [2026年六月25日 04:04 UTC](https://meta.discourse.org/t/gjs-template/406094 "2026-06-25T04:04:17Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [2026年六月25日 09:10 UTC](https://meta.discourse.org/t/gjs-template/406094/6 "2026-06-25T09:10:57Z")

</div>

```plaintext
@service search;

```

我发现直接在连接器里面直接访问search就能拿到数据了。根本不需要组件交互。

---

_[View the full topic](https://meta.discourse.org/t/gjs-template/406094)._
