You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
// app.js
|
|
|
|
|
import { setStorage, getStorage, removeStorage, clearStorage} from './utils/storage'
|
|
|
|
|
// import { asyncSetStorage, asyncGetStorage, asyncRemoveStorage, asyncClearStorage} from './utils/storage'
|
|
|
|
|
// import { toast} from './utils/extendApi'
|
|
|
|
|
|
|
|
|
|
App({
|
|
|
|
|
async onShow(){
|
|
|
|
|
//测试封装函数
|
|
|
|
|
// toast({toast:'o( ̄▽ ̄)d',icon:'error'})
|
|
|
|
|
|
|
|
|
|
// setStorage('id',1)
|
|
|
|
|
// setStorage('identify',1)
|
|
|
|
|
// const name = getStorage('name')
|
|
|
|
|
// console.log(name)
|
|
|
|
|
// removeStorage('name')
|
|
|
|
|
// clearStorage()
|
|
|
|
|
|
|
|
|
|
// asyncSetStorage('name','Jerry').then((res) =>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// })
|
|
|
|
|
// asyncSetStorage('age','28').then((res) =>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// })
|
|
|
|
|
// asyncGetStorage('name').then((res) =>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// })
|
|
|
|
|
// asyncRemoveStorage('name').then((res) =>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// })
|
|
|
|
|
// asyncClearStorage().then((res) =>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
globalData: {
|
|
|
|
|
userInfo: null
|
|
|
|
|
}
|
|
|
|
|
})
|