-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
77996db
commit fbfc107
Showing
7 changed files
with
98 additions
and
14 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
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
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,45 @@ | ||
# setMode | ||
|
||
## Introduction | ||
|
||
`setMode` Can switch view operation mode | ||
|
||
## Arguments | ||
|
||
- `{IDrawType}` `mode` View operating mode | ||
- `'select'`: Selection mode, also the default mode, is used to select and edit elements | ||
- `'drag'`: Drag mode, used to drag and move the overall canvas position | ||
- `'readOnly'`: Read-only mode, only displays the view content and cannot be edited | ||
|
||
```ts | ||
type IDrawMode = 'select' | 'drag' | 'readOnly'; | ||
``` | ||
|
||
## Returns | ||
|
||
> N/A | ||
## Usage | ||
|
||
```js | ||
import { iDraw } from 'idraw'; | ||
|
||
const app = document.querySelector('#app'); | ||
const options = { | ||
width: 600, | ||
height: 400, | ||
devicePixelRatio: 2 | ||
}; | ||
const idraw = new iDraw(app, options); | ||
idraw.setMode('readOnly'); | ||
``` | ||
|
||
## Example | ||
|
||
[More Demo >>](https://idrawjs.com/playground/?demo=api-resize) | ||
|
||
<iframe class="idraw-playground-preview" | ||
src="https://idrawjs.com/playground/?demo=api-setMode&header=false&sider=false&default-editor-split=50" | ||
width="1000" height="480" frameborder="no" border="0" | ||
style="border: 1px solid #cecece; margin: 0px auto;" | ||
></iframe> |
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
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,45 @@ | ||
# setMode | ||
|
||
## 说明 | ||
|
||
`setMode` 可以切换视图操作模式 | ||
|
||
## 参数 | ||
|
||
- `{IDrawType}` `mode` 视图操作模式 | ||
- `'select'`: 选择模式,也是默认模式,用于选择和编辑元素 | ||
- `'drag'`: 拖拽模式,用于拖拽移动整体画布位置 | ||
- `'readOnly'`: 只读模式,仅显示视图内容,无法进行编辑操作 | ||
|
||
```ts | ||
type IDrawMode = 'select' | 'drag' | 'readOnly'; | ||
``` | ||
|
||
## 返回值 | ||
|
||
> 无返回值 | ||
## 用法 | ||
|
||
```js | ||
import { iDraw } from 'idraw'; | ||
|
||
const app = document.querySelector('#app'); | ||
const options = { | ||
width: 600, | ||
height: 400, | ||
devicePixelRatio: 2 | ||
}; | ||
const idraw = new iDraw(app, options); | ||
idraw.setMode('readOnly'); | ||
``` | ||
|
||
## 示例 | ||
|
||
[Demo完整预览 Playground >>](https://idrawjs.com/playground/?demo=api-resize) | ||
|
||
<iframe class="idraw-playground-preview" | ||
src="https://idrawjs.com/playground/?demo=api-setMode&header=false&sider=false&default-editor-split=50" | ||
width="1000" height="480" frameborder="no" border="0" | ||
style="border: 1px solid #cecece; margin: 0px auto;" | ||
></iframe> |