import { Loading } from 'element-ui'
import { i18n } from "@/utils/i18ns";

class CmsLoading {
  static open = function(options) {
    return Loading.service(
      Object.assign({
        lock: false,
        text: i18n.t('common.message.loadingMsg'),
        fullscreen: false,
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.5)',
        target: document.body.querySelector('body')
      }, options)
    )
  }
}

export default CmsLoading
