egoist
8/20/2016 - 4:25 AM

about-eme-plugin.md

A plugin should only do one thing and do it well, eg, a word-count plugin:

module.exports = () => {
  return {
    type: 'component',
    mountTo: '#footer-left',
    component: {
      render(h) {
        const {wordCount} = this.$store.editor.tabs[this.$store.editor.currentTabIndex]
        return h(
          'span',
          {class: 'word-count'},
          wordCount
        )
      }
    }
  }
}