modules/BSModule.js
// import module or go to another page
import module or go to another page
import module or go to another page
autoHandle(name = '', {target = '', data = {}} = {}) {
    const currentPathname = location.pathname
    const targetPathname = target || currentPathname
    if (currentPathname === targetPathname) {
      BSModule.dataStorage[name] = data
      this.applyModule(name, true)
    } else {
      Object.assign(
          data, {
            _from_: currentPathname
          }
      )
      location.href = `${targetPathname}#${name}?${BSData.object2Body(data)}`
    }
  }
autoHandle ( name = '' , { target = '' , data = { } } = { } ) { const currentPathname = location . pathname const targetPathname = target || currentPathname if ( currentPathname === targetPathname ) { BSModule . dataStorage [ name ] = data this . applyModule ( name , true ) } else { Object . assign ( data , { _from_ : currentPathname } ) location . href = ` ${ targetPathname } ${ name } ${ BSData . object2Body ( data ) } ` } }
import module or go to another page
import module or go to another page