feat: 对话跳转
This commit is contained in:
44
src/stores/agent.ts
Normal file
44
src/stores/agent.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
// 每一个存储的模块,命名规则use开头,store结尾
|
||||
import router from '@/router'
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import { removeLocal, setLocal } from '@/utils/local'
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
|
||||
|
||||
// Agent 项目初始数据 store
|
||||
export const useAgentStore = defineStore('agent', () => {
|
||||
const initialProjectData = ref<{
|
||||
text: string
|
||||
images: Array<{ url: string; name: string }>
|
||||
type: string
|
||||
area: string
|
||||
style: string
|
||||
} | null>(null)
|
||||
|
||||
// 保存项目初始数据
|
||||
const setInitialProjectData = (data: {
|
||||
text: string
|
||||
images: Array<{ url: string; name: string }>
|
||||
type: string
|
||||
area: string
|
||||
style: string
|
||||
}) => {
|
||||
initialProjectData.value = data
|
||||
}
|
||||
|
||||
// 获取项目初始数据
|
||||
const getInitialProjectData = computed(() => initialProjectData.value)
|
||||
|
||||
// 清空项目初始数据
|
||||
const clearInitialProjectData = () => {
|
||||
initialProjectData.value = null
|
||||
}
|
||||
|
||||
return {
|
||||
initialProjectData,
|
||||
setInitialProjectData,
|
||||
getInitialProjectData,
|
||||
clearInitialProjectData
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user