fix: 类型报错
This commit is contained in:
parent
8de552d83a
commit
245d74b9eb
@ -1,6 +1,5 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { IUserInfo } from '../typings'
|
||||
|
||||
const initState = { nickname: '', avatar: '' }
|
||||
|
||||
|
15
src/typings.d.ts
vendored
15
src/typings.d.ts
vendored
@ -1,13 +1,22 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
// 全局要用的类型放到这里
|
||||
|
||||
export type IResData<T> = {
|
||||
type IResData<T> = {
|
||||
code: number
|
||||
msg: string
|
||||
result: T
|
||||
}
|
||||
|
||||
export type IUserInfo = {
|
||||
// uni.uploadFile文件上传参数
|
||||
type IUniUploadFileOptions = {
|
||||
file?: File
|
||||
files?: UniApp.UploadFileOptionFiles[]
|
||||
filePath?: string
|
||||
name?: string
|
||||
formData?: any
|
||||
}
|
||||
|
||||
type IUserInfo = {
|
||||
nickname?: string
|
||||
avatar?: string
|
||||
/** 微信的 openid,非微信没有这个字段 */
|
||||
@ -15,7 +24,7 @@ export type IUserInfo = {
|
||||
token?: string
|
||||
}
|
||||
|
||||
export enum TestEnum {
|
||||
enum TestEnum {
|
||||
A = 'a',
|
||||
B = 'b',
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import pagesJson from '@/pages.json'
|
||||
import { translate as t } from '@/locale/index'
|
||||
import pagesJson from '@/pages.json'
|
||||
|
||||
console.log(pagesJson)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user