Ryan Wang
|
4c6abdcaa1
|
feat: enable asynchronous resolving for UI extension points (#6018)
#### What type of PR is this?
/area ui
/kind feature
/milestone 2.16.x
#### What this PR does / why we need it:
优化 UI 部分的扩展点获取实现,让部分扩展点支持异步获取,之前的实现与文档不符。
比如:
```ts
import { definePlugin } from "@halo-dev/console-shared";
import axios from "axios";
export default definePlugin({
components: {},
routes: [],
extensionPoints: {
"attachment:selector:create": async () => {
const { data } = await axios.get(
"/apis/v1alpha1/fake.halo.run/attachments/selectors"
);
return data;
},
},
});
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/6008
#### Does this PR introduce a user-facing change?
```release-note
优化 UI 部分的扩展点获取实现,让部分扩展点支持异步获取。
```
|
2024-05-30 07:01:15 +00:00 |