1 changed files with 52 additions and 0 deletions
@ -0,0 +1,52 @@ |
|||||
|
//定义组合式API仓库
|
||||
|
import { defineStore } from "pinia"; |
||||
|
import { ref, computed,watch,reactive} from 'vue'; |
||||
|
type VideoMsg = { |
||||
|
CreatedAt: string |
||||
|
UpdatedAt: string |
||||
|
fileSize: bigint |
||||
|
id: bigint |
||||
|
key: string |
||||
|
name: string |
||||
|
physicspath: string |
||||
|
size: string |
||||
|
tag: string |
||||
|
type: number |
||||
|
url: string |
||||
|
} |
||||
|
/* type VideoObj = {} */ |
||||
|
|
||||
|
|
||||
|
//创建小仓库
|
||||
|
let uselowcodevideoStore = defineStore('lowcodevideo', () => { |
||||
|
|
||||
|
//视频地址
|
||||
|
const videoResource = ref<string>(); |
||||
|
//是否上传成功
|
||||
|
const videoReady = ref(false); |
||||
|
//成功后接受的视频详细信息
|
||||
|
const videoMsg = reactive<VideoMsg>({ |
||||
|
CreatedAt: '', |
||||
|
UpdatedAt: '', |
||||
|
fileSize: 0n, |
||||
|
id: 0n, |
||||
|
key: '', |
||||
|
name: '', |
||||
|
physicspath: '', |
||||
|
size: '', |
||||
|
tag: '', |
||||
|
type: 0, |
||||
|
url: '' |
||||
|
}); |
||||
|
//表单视频信息数组
|
||||
|
/* const videoArr = reactive<> */ |
||||
|
|
||||
|
//务必要返回一个对象:属性与方法可以提供给组件使用
|
||||
|
return { |
||||
|
videoReady, |
||||
|
videoResource, |
||||
|
videoMsg, |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
export default uselowcodevideoStore; |
||||
Loading…
Reference in new issue