-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from TDesignOteam/feat/mobile/back-top
feat(back-top): add visibilityHeight,container api
- Loading branch information
Showing
8 changed files
with
181 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/products/tdesign-mobile-vue/src/back-top/props.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdBackTopProps } from './type'; | ||
import { PropType } from 'vue'; | ||
|
||
export default { | ||
/** 滚动的容器 */ | ||
container: { | ||
type: Function as PropType<TdBackTopProps['container']>, | ||
}, | ||
/** 是否绝对定位固定到屏幕右下方 */ | ||
fixed: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
/** 图标 */ | ||
icon: { | ||
type: [Boolean, Function] as PropType<TdBackTopProps['icon']>, | ||
default: true, | ||
}, | ||
/** 定位滚动到指定对象 */ | ||
target: { | ||
type: Function as PropType<TdBackTopProps['target']>, | ||
}, | ||
/** 文案 */ | ||
text: { | ||
type: String, | ||
default: '', | ||
}, | ||
/** 预设的样式类型 */ | ||
theme: { | ||
type: String as PropType<TdBackTopProps['theme']>, | ||
default: 'round' as TdBackTopProps['theme'], | ||
validator(val: TdBackTopProps['theme']): boolean { | ||
if (!val) return true; | ||
return ['round', 'half-round', 'round-dark', 'half-round-dark'].includes(val); | ||
}, | ||
}, | ||
/** 滚动高度达到此参数值才出现 */ | ||
visibilityHeight: { | ||
type: Number, | ||
default: 200, | ||
}, | ||
/** 点击触发 */ | ||
onToTop: Function as PropType<TdBackTopProps['onToTop']>, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TNode } from '../common'; | ||
|
||
export interface TdBackTopProps { | ||
/** | ||
* 滚动的容器 | ||
*/ | ||
container?: () => HTMLElement; | ||
/** | ||
* 是否绝对定位固定到屏幕右下方 | ||
* @default true | ||
*/ | ||
fixed?: boolean; | ||
/** | ||
* 图标 | ||
* @default true | ||
*/ | ||
icon?: boolean | TNode; | ||
/** | ||
* 定位滚动到指定对象 | ||
*/ | ||
target?: () => HTMLElement; | ||
/** | ||
* 文案 | ||
* @default '' | ||
*/ | ||
text?: string; | ||
/** | ||
* 预设的样式类型 | ||
* @default round | ||
*/ | ||
theme?: 'round' | 'half-round' | 'round-dark' | 'half-round-dark'; | ||
/** | ||
* 滚动高度达到此参数值才出现 | ||
* @default 200 | ||
*/ | ||
visibilityHeight?: number; | ||
/** | ||
* 点击触发 | ||
*/ | ||
onToTop?: () => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters