派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-04-16 6e72dab53f951c8080495a792dc36c8f7382ad17
src/components/layer/src/layer.js
@@ -25,6 +25,7 @@
      content: opt.content,
      area: opt.area
    } */
    self.closeAll()
    var options = mergeJson(opt, defOptions)
    const id = `notification_${new Date().getTime()}_${seed++}`
    options.id = id
@@ -55,7 +56,6 @@
   * @return {[type]}    [description]
   */
  self.close = function (id) {
    console.log(id)
    const oElm = document.getElementById(id).parentElement
    if (oElm) {
      document.body.removeChild(oElm)
@@ -111,22 +111,9 @@
   * @param  {[type]} id [description]
   * @return {[type]}    [description]
   */
  self.closeAll = function (type = -1) {
    const types = {
      page: 0,
      iframe: 1
    }
    if (type === -1) {
  self.closeAll = function () {
      for (const k in self.instances) {
        self.close(k)
      }
    } else {
      const targetType = types[type]
      for (const k in self.instances) {
        if (self.instances[k].type === targetType) {
          self.close(k)
        }
      }
    }
  }
  /**