-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: autosave 添加开关选项,默认关闭 #120
base: dev
Are you sure you want to change the base?
Conversation
Deploy preview for v-editor ready! Built with commit 9d38131 |
为啥不是 autosave :false 关闭该特性
|
已经有一个名为 autosave 的 emit 时间,如果重名的化容易产生歧义 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
属性应该是:autosave true or false,或传时间(ms)。属性叫这个,事件也叫这个,不冲突
src/v-editor.vue
Outdated
@@ -102,9 +104,12 @@ export default { | |||
/** | |||
* 关闭 autosave 功能,详见文档[Getting and saving data - CKEditor 5 Documentation](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/saving-data.html#autosave-feature) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个注释,应该说明,默认是关闭。可传 true 或 ms
src/v-editor.vue
Outdated
@@ -38,6 +38,8 @@ import CKEditor from '@ckeditor/ckeditor5-vue' | |||
import fullScreenIcon from './assets/fullscreen.vue' | |||
import fullScreenExitIcon from './assets/fullscreenexit.vue' | |||
|
|||
const DEFAULT_AUTOSAVE_WAITING_TIME = 8000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改成 5000
Why
需要控制 autosave 的开关
How
由于之前版本组件中autosave为自动打开的,所以提供一个 disable-autosave 的 prop
根据文档,可用autosave 的 waitingTime 代替 debounce 函数。
由于waitingTime默认值为1000ms,原使用debounce函数的方式会导致默认autosave时间不准确(9s)
Docs