# 如何在ajax调用后手动将内容添加到pluginOutlet？以及如何重新渲染或刷新pluginOutlet？

**URL:** <https://meta.discourse.org/t/how-to-manually-add-contents-to-pluginoutlet-after-ajax-call-and-how-to-rerender-or-refresh-a-pluginoutlet/266640>\
**Category:** Development\
**Created:** [2023年五月30日 19:37 UTC](https://meta.discourse.org/t/how-to-manually-add-contents-to-pluginoutlet-after-ajax-call-and-how-to-rerender-or-refresh-a-pluginoutlet/266640 "2023-05-30T19:37:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**Post date:** [2023年五月30日 22:13 UTC](https://meta.discourse.org/t/how-to-manually-add-contents-to-pluginoutlet-after-ajax-call-and-how-to-rerender-or-refresh-a-pluginoutlet/266640/2 "2023-05-30T22:13:51Z")

</div>

> [@Pixl8\_Nick](#):
>
> 我相信我不能像上面那样做，使用 `api.decorateWidget`，因为这是 pluginOutlet 而不是 widget

正确。有两种方法可以解决这个问题……

1. 您可以将自定义内容制作成 widget，然后像这样在 plugin outlet 中挂载 widget：

2. 保持 widget 装饰器不变，并创建一个单独的 Ember 组件，在 plugin outlet 中执行您想要的操作。我们一直在用 Ember 组件（Discourse 的大部分内容都是基于此构建的）来取代 widget。

---

_[View the full topic](https://meta.discourse.org/t/how-to-manually-add-contents-to-pluginoutlet-after-ajax-call-and-how-to-rerender-or-refresh-a-pluginoutlet/266640)._
