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+ |
$ npm install weshop-segment
// ES6
import Segment from 'weshop-segment' // The default
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
{
apiKey: string,
taskId: string,
handleMask: (mask: string) => void
}
$ npm install
$ npm run dev
MIT