weshop-segment
v0.0.4
Published
<p align="center"> <img src="https://txt2img-1322216870.cos.ap-shanghai.myqcloud.com/20240321-163646.jpeg" /> </p>
Downloads
2
Readme
React + TypeScript + Vite
A simple component for making elements segment.
<Segment apiKey="111" taskId="222" handleMask={handleMask}></Segment>
For more information about apiKey and taskId, please check https://open.weshop.com/authorization/apikey
| Version | Compatibility | | ------- | ------------- | | 0.x | React 18+ |
Installing
$ npm install weshop-segment
// ES6
import Segment from 'weshop-segment' // The default
Segment Usage
View the Demo at example/App.tsx
import Segment from 'weshop-segment'
import './index.less'
function App() {
const handleMask = (mask: string) => {
console.log(`您选择的区域为:${mask}`)
}
return (
<div className="App">
<div className="segment">
<div className="segment-content">
<Segment apiKey="111" taskId="222" handleMask={handleMask}></Segment>
</div>
</div>
</div>
)
}
export default App
<Segment>
Props:
{
apiKey: string,
taskId: string,
handleMask: (mask: string) => void
}
Run Demo
$ npm install
$ npm run dev
License
MIT