# 如何从插件覆盖 template.hbs

**URL:** <https://meta.discourse.org/t/how-to-override-a-template-hbs-from-a-plugin/155556>\
**Category:** Development\
**Created:** [2020年六月22日 13:02 UTC](https://meta.discourse.org/t/how-to-override-a-template-hbs-from-a-plugin/155556 "2020-06-22T13:02:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
**Post date:** [2020年六月30日 19:10 UTC](https://meta.discourse.org/t/how-to-override-a-template-hbs-from-a-plugin/155556/4 "2020-06-30T19:10:13Z")

</div>

也许这里对术语存在一些混淆。无论如何，只需使用：

```plaintext
<script type="text/x-handlebars" data-template-name="javascripts/components/template-name">
  
</script>

```

您无需在 `data-template-name` 中包含其他内容。它将被正确映射。

---

_[View the full topic](https://meta.discourse.org/t/how-to-override-a-template-hbs-from-a-plugin/155556)._
