vue-head.js
function (arr, tag, place, update) {
      var self = this
      if (!arr) return
      arr.map(function (obj) {
        var parent = (obj.body) ? self.getPlace('body') : self.getPlace(place)
        var el = window.document.getElementById(obj.id) || window.document.createElement(tag)
        // Elements that will substitute data
        if (el.hasAttribute('id')) {
          self.prepareElement(obj, el)
          return
        }
        // Other elements
        el = self.prepareElement(obj, el)
        // Updated elements
        if (update) {
          diffEls.push(el)
          return
        }
        // Append Elements
        self.add(obj, el, parent)
      })
    }
function (arr, tag, place, update) {
      var self = this
      if (!arr) return
      arr.map(function (obj) {
        var parent = (obj.body) ? self.getPlace('body') : self.getPlace(place)
        var el = window.document.getElementById(obj.id) || window.document.createElement(tag)
        // Elements that will substitute data
        if (el.hasAttribute('id')) {
          self.prepareElement(obj, el)
          return
        }
        // Other elements
        el = self.prepareElement(obj, el)
        // Updated elements
        if (update) {
          diffEls.push(el)
          return
        }
        // Append Elements
        self.add(obj, el, parent)
      })
    }
function ( arr , tag , place , update ) { var self = this if ( ! arr ) return arr . map ( function ( obj ) { var parent = ( obj . body ) ? self . getPlace ( 'body' ) : self . getPlace ( place ) var el = window . document . getElementById ( obj . id ) || window . document . createElement ( tag ) // Elements that will substitute data if ( el . hasAttribute ( 'id' ) ) { self . prepareElement ( obj , el ) return } // Other elements el = self . prepareElement ( obj , el ) // Updated elements if ( update ) { diffEls . push ( el ) return } // Append Elements self . add ( obj , el , parent ) } ) }
Handle of create elements
@type {Function}
@param  {Array} arr
@param  {String} tag   - style, link, meta, script, base
@param  {String} place - Default 'head'
@param  {Boolean} update
Handle of create elements