javascript - Quasar Vue 存储忽略状态属性
问题描述
我已经使用组合 API 构建了一个应用程序 Quasar,并且我正在使用 import { createPersistedState } from 'vuex-electron';
它来维护会话之间的某些属性。但是在我的情况下,有一个名为“ Search ”的属性,它是一个字符串,我不想保存。我怎么能忽略这个值?即使在阅读文档之后,我也不太确定这是如何完成的。
“搜索”处于该状态的原因是因为我需要从应用程序的各个部分访问它。
我的index.ts文件
import { store } from 'quasar/wrappers';
import Vuex from 'vuex';
import { createPersistedState } from 'vuex-electron';
import app from './app';
import { AppState } from 'src/models/types';
export interface StateInterface {
app: AppState;
}
const vuexElectonPlugin = createPersistedState({
// whitelist: (mutation) => {
// },
// blacklist: (mutation) => {
// }
});
export default store(function ({ Vue }) {
Vue.use(Vuex);
const Store = new Vuex.Store<StateInterface>({
modules: {
app
},
plugins: [vuexElectonPlugin],
// enable strict mode (adds overhead!)
// for dev mode only
strict: !!process.env.DEBUGGING
});
return Store;
});
解决方案
推荐阅读
- google-sheets - 带有 AND 条件和多个嵌套 QUERY 的嵌套 IF 语句
- ionic-framework - 离子波纹效应在普通的 html 按钮中不起作用
- azure - 为什么我收到 Azure Front Doors 400 错误
- rxjs - 使用 RxJS 从 Angular 7 服务中提取数据以订阅 DotNetCore WebAPI
- angular - 使用 Angularfire2 时比较两个异步值
- microsoft-graph-api - 为什么图形查询可以在一台机器上工作而不是另一台机器?
- php - 没有活动时如何在 php 中 30 分钟后注销用户?
- powershell - Powershell GET-ADComputer list 和 foreach 获取 WMI_Networkconf
- powershell - 如何取消加入域,重命名 PC,然后在一个脚本中将其加入新域
- rx-java - .defer() 在 RxJava 中做了什么?