Skip to content

likun7981/tinyapp-enhance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinyapp-enhance

支付宝小程序

安装

$ npm i tinyapp-enhance

列表

  • 组件监听当前页面的onPageScroll,onShow,onResize,onHide

使用方法

// 页面
// Pages/page1/xxx.js
import { enhancePage } from "tinyapp-enhance";

const options = {
  // Page的一些配置
}

- Page(options);
+ Page(enhancePage(options));

// 组件
// Components/xxx-component/xxx.js
import { enhanceComponent } from "tinyapp-enhance";

const options = {
+ pageLifetimes: {
+   onPageScroll({ scrollTop }) {
+    // 这里可以访问到使用该组件页面的滚动
+   },
+   onResize(){},
+   onShow(){},
+   onHide(){},
+ }
  // Component 其他配置
}

- Component(options);
+ Component(enhanceComponent(options));

说明

About

赋予支付宝小程序Component 访问当前Page 生命周期 的能力

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published