@aligov/pegasus
v1.0.2
Published
搭投组件
Downloads
25
Readme
demo component
@aligov/pegasus
搭投组件
用法
import React, { useState } from "react";
import { Pegasus, createPegasusActions } from '@aligov/pegasus';
function Test() {
const [loading, setLoading] = useState<boolean>(false);
const actions = createPegasusActions();
const onPublish = async () => {
try {
setLoading(true);
await actions.page.publish('release');
} catch (error) {
console.error(error);
} finally {
setLoading(false);
}
};
return (
<div>
<Button type="primary" loading={loading} onClick={onPublish}>
<Icon type="add" />
发布
</Button>
<Pegasus />
</div>
);
}