Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: {
extClass: {
type: String,
value: ''
},
title: {
type: String,
value: ''
},
background: {
type: String,
value: ''
},
color: {
type: String,
value: ''
},
back: {
type: Boolean,
value: true
},
loading: {
type: Boolean,
value: false
},
homeButton: {
type: Boolean,
value: false,
},
animated: {
// 显示隐藏的时候opacity动画效果
type: Boolean,
value: true
},
show: {
// 显示隐藏导航,隐藏的时候navigation-bar的高度占位还在
type: Boolean,
value: true,
observer: '_showChange'
},
// back为true的时候,返回的页面深度
delta: {
type: Number,
value: 1
},
},
/**
* 组件的初始数据
*/
data: {
displayStyle: ''
},
lifetimes: {
attached() {
const rect = wx.getMenuButtonBoundingClientRect()
wx.getSystemInfo({
success: (res) => {
const isAndroid = res.platform === 'android'
const isDevtools = res.platform === 'devtools'
this.setData({
ios: !isAndroid,
innerPaddingRight: `padding-right: ${res.windowWidth - rect.left}px`,
leftWidth: `width: ${res.windowWidth - rect.left }px`,
safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${res.safeArea.top}px); padding-top: ${res.safeArea.top}px` : ``
})
}
})
},
},
/**
* 组件的方法列表
*/
methods: {
_showChange(show) {
const animated = this.data.animated
let displayStyle = ''
if (animated) {
displayStyle = `opacity: ${
show ? '1' : '0'
};transition:opacity 0.5s;`
} else {
displayStyle = `display: ${show ? '' : 'none'}`
}
this.setData({
displayStyle
})
},
back() {
const data = this.data
if (data.delta) {
wx.navigateBack({
delta: data.delta
})
}
this.triggerEvent('back', { delta: data.delta }, {})
}
},
})
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序+上拉触底小案例
共32个文件
jpg:8个
json:8个
js:7个
需积分: 0 1 下载量 166 浏览量
2024-01-09
23:17:35
上传
评论
收藏 27KB ZIP 举报
温馨提示
微信小程序+上拉触底小案例
资源推荐
资源详情
资源评论
收起资源包目录
project_2 P44.zip (32个子文件)
project_2 P44
sitemap.json 191B
project.private.config.json 344B
pages
message
message.wxss 32B
message.js 824B
message.json 29B
message.wxml 74B
home
home.wxml 62B
home.json 29B
home.wxss 26B
home.js 818B
contact
contact.wxml 153B
contact.js 1KB
contact.wxss 255B
contact.json 29B
.eslintrc.js 587B
app.json 1KB
project.config.json 559B
app.js 364B
utils
util.js 460B
app.wxss 194B
components
navigation-bar
navigation-bar.wxss 4KB
navigation-bar.js 2KB
navigation-bar.wxml 2KB
navigation-bar.json 84B
images
tab
tabbar (1).jpg 2KB
tabbar (3).jpg 2KB
tabbar (2).jpg 2KB
tabbar 1.jpg 2KB
tabbar 2.jpg 2KB
tabbar 3.jpg 2KB
link
link1.jpg 2KB
link2.jpg 2KB
共 32 条
- 1
资源评论
m0_51519738
- 粉丝: 193
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功