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: 使用新的UI布局及替换toolbar的icon #111

Merged
merged 42 commits into from
Jul 31, 2020

Conversation

snowlocked
Copy link
Contributor

Why

按照UI替换icon,修改样式,使组件更美观

How

  1. 替换toolbar各个plugin的buttonView
  2. 引入原生的editing plugin
  3. 重新组装起来
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
// import 自己的UI
import BoldUI form './boldUI'
// import 原有功能
import BoldEditing from '@ckeditor/ckeditor5-basic-styles/src/bold/boldediting'
// 重新封装成自己的plugin
export default class Bold extends Plugin {
  /**
   * @inheritDoc
   */
  static get requires() {
    return [ BoldEditing, BoldUI ];
  }

  /**
   * @inheritDoc
   */
  static get pluginName() {
    return 'Bold';
  }
}

image

@auto-add-label auto-add-label bot added the enhancement New feature or request label Jul 17, 2020
Comment on lines 26 to 27
this._addButton('undo', '撤销', 'CTRL+Z', localizedUndoIcon)
this._addButton('redo', '重做', 'CTRL+Y', localizedRedoIcon)
Copy link
Contributor

@eviIIt eviIIt Jul 17, 2020

Choose a reason for hiding this comment

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

不知道有没有兼容 macOS

Copy link
Contributor Author

@snowlocked snowlocked Jul 17, 2020

Choose a reason for hiding this comment

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

这个是原来原生逻辑搬下来的,只用于显示

@netlify
Copy link

netlify bot commented Jul 17, 2020

Deploy preview for v-editor ready!

Built with commit eeef861

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

src/v-editor.vue Outdated Show resolved Hide resolved
src/v-editor.vue Outdated Show resolved Hide resolved
@levy9527
Copy link
Contributor

在 toolbar 里,把 H,修改成 "正文“。注意,把“正文”切换成 “标题”时,toolbar 的宽度不会抖动。现在宽度是会变化的:

变窄
image
变宽
image

@snowlocked
Copy link
Contributor Author

在 toolbar 里,把 H,修改成 "正文“。注意,把“正文”切换成 “标题”时,toolbar 的宽度不会抖动。现在宽度是会变化的:

变窄
image
变宽
image

已设置为居中,宽度固定45px

@levy9527 levy9527 merged commit 8368bd7 into FEMessage:dev Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants