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.
40 lines
787 B
40 lines
787 B
/**
|
|
* 接收传参 store
|
|
*/
|
|
import { defineStore } from 'pinia';
|
|
|
|
export interface ParamsState {
|
|
title: string | null;
|
|
comments: string | null;
|
|
back: string | null;
|
|
redirect: string | null | undefined;
|
|
}
|
|
|
|
export const useParamsStore = defineStore({
|
|
id: 'params',
|
|
state: (): ParamsState => ({
|
|
// 标题
|
|
title: '操作成功',
|
|
// 描述
|
|
comments: '您的申请已提交',
|
|
// 当前页面路径
|
|
back: null,
|
|
// 跳转的页面
|
|
redirect: null
|
|
}),
|
|
getters: {},
|
|
actions: {
|
|
setTitle(value: string) {
|
|
this.title = value;
|
|
},
|
|
setComments(value: string) {
|
|
this.comments = value;
|
|
},
|
|
setBack(value: string) {
|
|
this.back = value;
|
|
},
|
|
setRedirect(value: string) {
|
|
this.redirect = value;
|
|
}
|
|
}
|
|
});
|