Skip to content

Commit

Permalink
fix: removeChild of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
洛竹 committed Nov 14, 2021
1 parent 4ec5b2f commit 2eeb71b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ npm install kityminder-react
## 示例

```tsx
/**
* defaultShowCode: true
* hideActions: ["EXTERNAL"]
*/
import React from 'react';
import './index.css';
import KityMinder from 'kityminder-react';
Expand Down
7 changes: 4 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ export default ({ data }: IKityMinderProps) => {
kityRef.current.append(JSON.stringify(data));
// 创建 km 实例
// @ts-ignore
var km = new kityminder.Minder();
var km = (window.km = new kityminder.Minder());
km.setup(kityRef.current);
km.disable();
km.execCommand('hand');
}
}, [data]);

return (
<script
<div
ref={kityRef}
// @ts-ignore
type="application/kityminder"
minder-data-type="json"
></script>
></div>
);
};

0 comments on commit 2eeb71b

Please sign in to comment.