index.js 618 字节
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4 5 6 7 8
export function initPage () {

}

export function initComponent () {

}

9 10
export function triggerLink (mpInstance, vueOptions) {
  mpInstance.triggerEvent('__l', mpInstance.$vm || vueOptions, {
11 12 13 14 15 16
    bubbles: true,
    composed: true
  })
}

export function handleLink (event) {
17 18 19 20
  if (event.detail.$mp) { // vm
    if (!event.detail.$parent) {
      event.detail.$parent = this.$vm
      event.detail.$parent.$children.push(event.detail)
21

22 23 24 25 26 27
      event.detail.$root = this.$vm.$root
    }
  } else { // vueOptions
    if (!event.detail.parent) {
      event.detail.parent = this.$vm
    }
28 29
  }
}