Skip to content

Commit

Permalink
fix: fix type of animation in MovableViewProps (#1747)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan authored and luckyadam committed Dec 28, 2018
1 parent 01afc26 commit 0ffaf9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/taro-components/types/MovableView.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentType } from 'react'
import { StandardProps, BaseEventFunction, TouchEventFunction } from './common'
import { StandardProps, BaseEventFunction, TouchEventFunction, Omit } from './common'

interface MovableAreaProps extends StandardProps {

Expand All @@ -12,7 +12,7 @@ interface MovableAreaProps extends StandardProps {
}


interface MovableViewProps extends StandardProps {
interface MovableViewProps extends Omit<StandardProps, 'animation'> {

/**
* movable-view的移动方向,属性值有`all`、`vertical`、`horizontal`、`none`
Expand Down Expand Up @@ -94,6 +94,15 @@ interface MovableViewProps extends StandardProps {
*/
scaleValue?: number,

/**
* 是否使用动画
*
* 基础库: 2.1.0
*
* 默认值:`true`
*/
animation?: boolean;

/**
* 拖动过程中触发的事件,event.detail = `{x: x, y: y, source: source}`,其中source表示产生移动的原因,值可为touch(拖动)、touch-out-of-bounds(超出移动范围)、out-of-bounds(超出移动范围后的回弹)、friction(惯性)和空字符串(setData)
*
Expand Down
2 changes: 2 additions & 0 deletions packages/taro-components/types/common.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { CSSProperties } from 'react';

export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T]>;

export interface StandardProps extends EventProps {
/**
* 组件的唯一标示, 保持整个页面唯一
Expand Down

0 comments on commit 0ffaf9f

Please sign in to comment.