Files
docs/versioned_docs/version-2.0/developer-guide/theme/finder-apis/plugin.md
Ryan Wang 5c76928800 chore: set 2.0 is latest version (#127)
将 2.0 版本的文档设置为最新的文档。同时保留 /2.0.0-SNAPSHOT/

/kind documentation

```release-note
None
```
2022-12-01 01:49:52 +00:00

34 lines
575 B
Markdown

---
title: 插件
description: 插件 - PluginFinder
---
## available(pluginName)
```js
pluginFinder.available(pluginName)
```
### 描述
判断一个插件是否可用,会同时判断插件是否安装和启用。
### 参数
1. `pluginName:string` - 插件的唯一标识 `metadata.name`
### 返回值
`boolean` - 插件是否可用
### 示例
```html
<!-- https://github.com/halo-sigs/plugin-search-widget -->
<li th:if="${pluginFinder.available('PluginSearchWidget')}">
<a href="javascript:SearchWidget.open()" title="搜索">
搜索
</a>
</li>
```