2025-04-29 16:46:25 +08:00

22 lines
439 B
JavaScript

Component({
properties: {
// 是否显示返回顶部按钮
show: {
type: Boolean,
value: false,
observer: function(newVal) {
this.setData({ isVisible: newVal });
}
}
},
data: {
isVisible: false
},
methods: {
// 触发父页面的返回顶部方法
scrollToTop() {
// 使用 triggerEvent 触发父页面的事件
this.triggerEvent('scrolltomain');
}
}
});