GITLAB

SxhGroup / sxhClockIn

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • sxhClockIn
  • component
  • v2
  • plugins
  • index.js
  • d46806b9   结构调整 ... Browse Code »
    结构调整
    边
    2022-09-30 15:05:26 +0800  
index.js 376 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import preset from './preset/index'

export default {
  installed: [...preset],
  use(plugin) {
    if (typeof plugin !== 'function') return
    const info = plugin() || {}
    const { name } = info
    if (
      name &&
      name !== 'methods' &&
      !this.installed.some(p => p[0] === name)
    ) {
      this.installed.unshift([name, info])
    }
    return this
  }
}