-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
768 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
## 1.0.2(2024-04-18) | ||
|
||
- 新增颜色吸管 | ||
- 新增 SDK 包,支持 vue 引入 | ||
|
||
## 1.0.1(2024-04-15) | ||
|
||
- 新增插件扩展功能 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# SDK 框架中的使用 | ||
|
||
为了方便大家在 vue 项目中快速使用渲染内核做二次开发,我们提供了一个 JS 的 SDK,下面是 vue 中使用渲染内核的案例: | ||
|
||
具体完整代码请参考`sdk-test/vue.html`文件: | ||
|
||
官网:[image.h5ds.com](https://image.h5ds.com) | ||
|
||
### VUE | ||
|
||
```javascript | ||
import { ref } from 'vue'; | ||
import ImageEditorCore from 'image-editor-core'; | ||
|
||
export default { | ||
async mounted() { | ||
const core = new ImageEditorCore({ | ||
data: pageData, | ||
target: document.getElementById('view'), | ||
env: 'editor', | ||
resourceHost: 'https://cdn.h5ds.com', | ||
}); | ||
const store = await core.init(); | ||
console.log(store); | ||
}, | ||
template: `<div id="view">loading...</div>`, | ||
}; | ||
``` | ||
|
||
### React | ||
|
||
```javascript | ||
import React, { useRef } from 'react'; | ||
import ImageEditorCore from 'image-editor-core/coresdk.react.es'; | ||
|
||
export default function App() { | ||
const ref = useRef(); | ||
useEffect(() => { | ||
const core = new ImageEditorCore({ | ||
data: pageData, | ||
target: ref.current, | ||
env: 'editor', | ||
resourceHost: 'https://cdn.h5ds.com', | ||
}); | ||
core.init().then(store => { | ||
console.log(store); | ||
}); | ||
}, []); | ||
|
||
return <div ref={ref}>loading...</div>; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"name": "image-editor", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "mantou <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"build": "vite build && yarn build:sdk", | ||
"server": "node ./server/index.js", | ||
"preview": "vite preview --port 8080", | ||
"lint": "eslint src --fix", | ||
|
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.