uniapp经验总结1
打包h51、设置mainfest.json中h5节点的publicPath为:"./" 2、打包完毕后找到index.xxxxx.js文件,将uniConfig.router={mode:"hash",base:"/"}修改为uniConfig.router={mode:"hash",base:"./"} 请求延迟 "networkTimeout" : { "uploadFile" : 100000000, "request" : 100000000 }, 大项目打包h5 "h5" : { "title" : "微领", "domain" : "", "router" : { "mode" : "hash", "base" : "./" }, "publicPath" : "./", "optimization" : { "treeShaking" : { "enable" : true } }, "uniStatistics" : { "enable" : false }, "sdkConfigs" : { "maps" : {} } }app跳转到网页 // #ifdef APP-PLUS var url ="www.baidu.com" plus.runtime.openURL( url ); // #endifh5跳转到网页// #ifdef H5 window.location.href=that.urls // #endifcolorUI动画style有animationDelay:0.1s//动画延时 clss有animation-reverse//动画逆行 animation-动画名 fade//淡入 scale-up//变大进入 scale-down//变小进入 slide-top//上入 slide-bottom//下入 slide-left//左入 slide-right//右入 shake//颤抖 打开app的方法if (plus.os.name == "Android") { //判断是app plus.runtime.launchApplication( { pname: "com.ss.android.ugc.aweme" //软件包名,用跳转网页方法也可以打开app }, function(e) { console.log("Open system default browser failed: " + e.message); } ); }else if (plus.os.name == "iOS") { //判断是ios plus.runtime.launchApplication( { action:"snssdk1128://aweme" //网页地址 }, function(e) { console.log("Open system default browser failed: " + e.message); }); } 富文本方法 data() { return { image:"" } }, computed:{ nodes(){ let node = this.image; node = node.replace(/ import Return from "../components/return.vue" components:{ Return },过滤器买家姓名:{{lists.name|nulls}} filters:{ nulls(data){ if(data==undefined){ return ""} } }顶部状态框高度calc(var(--status-bar-height) height: var(--status-bar-height); padding-top: calc(var(--status-bar-height) + 30rpx); plus.runtime.versionCode //版本号不带点 plus.runtime.version //版本号带点 min-height: 100vh;//自适应高