一 tabBar不显示的问题
tabBar放在pages下面,不能放在globalStyle下面

二 小程序的标签不起效
bindinput改成@input
this.data改成this.$data
this.setData改成this.$data
bindtap改成@click
data-name="{{book1}}"改成v-bind:data-name="book1"

三 navigateTo不起效
url注意绝对路径
url: '/pages/read_book/read_book'

四 uni.getFileSystemManager调试失败
uni.getFileSystemManager仅支持部分小程序
需要进行判断
异步(uni.getSystemInfo)和同步(uni.getSystemInfoSync)的2个API获取系统信息

switch (uni.getSystemInfoSync().platform) {
  case 'web':
    console.log('Web');
    break;
  case 'mp-weixin':
    console.log('mp-weixin');
    break;
  default:
    console.log('开发者工具');
    break;
}

五 静态文件跨域
对于页面,在后端添加
fastadmin的配置项为config.php的cors_request_domain
对于静态文件,在后端添加无效
直接在nginx中针对文件的类型进行设置

location ~ .*\.(txt)?$
{
      add_header 'Access-Control-Allow-Origin' '*';
      add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
      add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}

六 UI切换
weui切换到uni-ui,直接安装插件
部分宽度涉及到计算时
width: calc(100% - 13px);

标签: none

评论已关闭