Skip to content
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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

shoyuf
Copy link
Member

@shoyuf shoyuf commented Aug 27, 2020

Why

需要控制 autosave 的开关

How

由于之前版本组件中autosave为自动打开的,所以提供一个 disable-autosave 的 prop

根据文档,可用autosave 的 waitingTime 代替 debounce 函数。
由于waitingTime默认值为1000ms,原使用debounce函数的方式会导致默认autosave时间不准确(9s)

Docs

image

@auto-add-label auto-add-label bot added the enhancement New feature or request label Aug 27, 2020
@netlify
Copy link

netlify bot commented Aug 27, 2020

Deploy preview for v-editor ready!

Built with commit 9d38131

https://deploy-preview-120--v-editor.netlify.app

@levy9527
Copy link
Contributor

levy9527 commented Aug 27, 2020 via email

@shoyuf
Copy link
Member Author

shoyuf commented Aug 27, 2020

为啥不是 autosave :false 关闭该特性

已经有一个名为 autosave 的 emit 时间,如果重名的化容易产生歧义

Copy link
Contributor

@levy9527 levy9527 left a 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)。属性叫这个,事件也叫这个,不冲突

@levy9527 levy9527 changed the title feat: 关闭 autosave 功能 feat: 关闭 autosave 功能 WIP Sep 1, 2020
@shoyuf shoyuf marked this pull request as draft September 1, 2020 10:55
@shoyuf shoyuf marked this pull request as ready for review September 2, 2020 02:20
@shoyuf shoyuf requested a review from levy9527 September 2, 2020 02:20
@shoyuf shoyuf changed the title feat: 关闭 autosave 功能 WIP feat!: autosave 添加开关选项,默认关闭 Sep 2, 2020
@auto-add-label auto-add-label bot added breaking-change and removed enhancement New feature or request labels Sep 2, 2020
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)
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改成 5000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants