Fork自 DCloud / uni-app
体验新版 GitCode,发现更多精彩内容 >>
import { hasOwn } from 'uni-shared' const LIFECYCLE = { 'created': 'created', 'attached': 'created', 'ready': 'mounted', 'moved': 'moved', 'detached': 'destroyed' } const LIFECYCLE_KEYS = Object.keys(LIFECYCLE)
export function parseLifecycle (mpComponentOptions, vueComponentOptions) { Object.keys(LIFECYCLE_KEYS).forEach(name => { if (hasOwn(mpComponentOptions, name)) { vueComponentOptions[LIFECYCLE[name]] = mpComponentOptions[name] } })
}