Ai
3 Star 11 Fork 17

QuickD/demo-uniapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
App.vue 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
QuickD 提交于 2019-10-02 09:36 +08:00 . no commit message
<script>
import Vue from 'vue'
export default {
data() {
return {
}
},
onLaunch: function () {
console.log('App Launch');
uni.getSystemInfo({
success: function(e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
}
})
},
onShow: function () {
console.log('App Show');
},
onHide: function () {
console.log('App Hide');
},
methods:{
}
}
</script>
<style>
@import "colorui/main.css";
@import "colorui/icon.css";
/*必填项*/
.required:after{
content:'*';
position: relative;
top: -10px;
color: #e00;
font-size: 12px;
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/quickd/demo-uniapp.git
git@gitee.com:quickd/demo-uniapp.git
quickd
demo-uniapp
demo-uniapp
master

搜索帮助