uniapp 知识点

本地存储(存、取、删除)
uni.setStorageSync(key,value)
uni.getStorageSync(key)
uni.removeStorageSync(key)

上传图片
* uni.chooseImage方法从本地相册选择图片或使用相机拍照。
    uni.chooseImage({
       count: 3,
       success: res=>{}
    })
预览图片
* uni.previewImage()
   uni.previewImage({
      urls: arr,
      current
   })
代码显示终端
<!-- #ifdef H5>
<view>H5端显示的代码</view>
<!-- #endif -->

<!-- #ifdef MP-WEIXIN>
<view>微信端显示的代码</view>
<!-- #endif -->

<!-- #ifdef APP-PLUS>
<view>APP端显示的代码</view>
<!-- #endif -->

页面跳转
保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面
uni.navigateTo(OBJECT)

关闭当前页面,跳转到应用内的某个页面。
uni.redirectTo(OBJECT)

关闭所有页面,打开到应用内的某个页面。
uni.reLaunch(OBJECT)

跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。
uni.switchTab(OBJECT)

关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。
uni.navigateBack(OBJECT)

你可能感兴趣的:(uni-app)