Skip to content

Commit

Permalink
fix(taro-quickapp): 页面需暴露 onRefresh 函数,close #4078
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Aug 6, 2019
1 parent 715fd3c commit 8943efa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/taro-quickapp/src/create-component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import camelCase from 'lodash/camelCase'

import { isEmptyObject, queryToJson, addLeadingSlash } from './util'
import { isEmptyObject, noop, addLeadingSlash } from './util'
import { cacheDataGet, cacheDataHas } from './data-cache'
import { updateComponent } from './lifecycle'
import appGlobal from './global'
Expand All @@ -9,7 +9,7 @@ const privatePropValName = 'privatetriggerobserer'
const anonymousFnNamePreffix = 'funPrivate'
const componentFnReg = /^prv-fn-/
const PRELOAD_DATA_KEY = 'preload'
const pageExtraFns = ['onBackPress', 'onMenuPress']
const pageExtraFns = ['onBackPress', 'onMenuPress', 'onRefresh']

function filterProps (properties, defaultProps = {}, componentProps = {}, componentData) {
let newProps = Object.assign({}, componentProps)
Expand Down Expand Up @@ -242,6 +242,7 @@ function initComponent (ComponentClass, isPage) {
export function componentTrigger (component, key, args) {
args = args || []

// eslint-disable-next-line no-useless-call
component[key] && typeof component[key] === 'function' && component[key].call(component, ...args)
if (key === 'componentWillMount') {
component._dirty = false
Expand Down

0 comments on commit 8943efa

Please sign in to comment.