How to use the vuex-module-decorators.Module function in vuex-module-decorators

To help you get started, we’ve selected a few vuex-module-decorators examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github siegrainwong / ancorazor / src / client.vue / blog.client / src / common / stores / formModule.ts View on Github external
import { Module, VuexModule, Mutation } from 'vuex-module-decorators'
import DialogViewModel from "@/common/viewmodels/dialogViewModel"

@Module({ name: "FormModule" })
export default class FormModule extends VuexModule {
    form: DialogViewModel = new DialogViewModel()

    @Mutation
    setForm(val: DialogViewModel) {
        this.form = val
    }
}
github dotnetcore / WTM / demo / WalkingTec.Mvvm.VueDemo / ClientApp / src / store / modules / settings.ts View on Github external
import { setSettings, getSettings } from "@/util/cookie";
import defaultSettings from "@/settings";

export interface ISettingsState {
  title: string;
  theme: string;
  fixedHeader: boolean;
  showSettings: boolean;
  showTagsView: boolean;
  showSidebarLogo: boolean;
  sidebarTextTheme: boolean;
  isDialog: boolean;
  menuBackgroundImg: any;
}

@Module({ dynamic: true, store, name: "settings" })
class Settings extends VuexModule implements ISettingsState {

  public title = defaultSettings.title;
  public theme = variables.theme;
  public fixedHeader = defaultSettings.fixedHeader;
  public showSettings = defaultSettings.showSettings;
  public showTagsView = defaultSettings.showTagsView;
  public showSidebarLogo = defaultSettings.showSidebarLogo;
  public sidebarTextTheme = defaultSettings.sidebarTextTheme;
  public isDialog = defaultSettings.isDialog;
  public menuBackgroundImg = defaultSettings.menuBackgroundImg;

  @Mutation
  private CHANGE_SETTING(payload: { key: string; value: any }) {
    const { key, value } = payload;
    if (Object.prototype.hasOwnProperty.call(this, key)) {
github apache / apisix-dashboard / src / store / modules / settings.ts View on Github external
import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
import store from '@/store'
import elementVariables from '@/styles/element-variables.scss'
import defaultSettings from '@/settings'

export interface ISettingsState {
  theme: string
  fixedHeader: boolean
  showSettings: boolean
  showTagsView: boolean
  showSidebarLogo: boolean
  sidebarTextTheme: boolean
}

@Module({ dynamic: true, store, name: 'settings' })
class Settings extends VuexModule implements ISettingsState {
  public theme = elementVariables.theme
  public fixedHeader = defaultSettings.fixedHeader
  public showSettings = defaultSettings.showSettings
  public showTagsView = defaultSettings.showTagsView
  public showSidebarLogo = defaultSettings.showSidebarLogo
  public sidebarTextTheme = defaultSettings.sidebarTextTheme

  @Mutation
  private CHANGE_SETTING(payload: { key: string, value: any }) {
    const { key, value } = payload
    if (this.hasOwnProperty(key)) {
      (this as any)[key] = value
    }
  }
github dotnetcore / WTM / demo / WalkingTec.Mvvm.VueDemo / ClientApp / src / store / modules / user.ts View on Github external
import { getToken, setToken, removeToken } from "@/util/cookie";
import { resetRouter } from "@/router";
import store from "@/store/modules/index";
import _request from "@/util/service";
import serviceUrl from "@/service/modules/user";

export interface IUserState {
  token: string;
  name: string;
  roles: Array;
  actionList: string[];
  menus: any[];
  info: any;
}

@Module({ dynamic: true, store, name: "user" })
class User extends VuexModule implements IUserState {
  public token = getToken() || "";
  public name = "";
  public roles: Array = [];
  public actionList: string[] = [];
  public menus: Array = [];
  public info = {};

  @Mutation
  private SET_TOKEN(token: string) {
    this.token = token;
  }

  @Mutation
  private SET_NAME(name: string) {
    this.name = name;
github apache / apisix-dashboard / src / store / modules / user.ts View on Github external
import { getToken, setToken, removeToken } from '@/utils/cookies'
import router, { resetRouter } from '@/router'
import { PermissionModule } from './permission'
import { TagsViewModule } from './tags-view'
import store from '@/store'

export interface IUserState {
  token: string
  name: string
  avatar: string
  introduction: string
  roles: string[]
  email: string
}

@Module({ dynamic: true, store, name: 'user' })
class User extends VuexModule implements IUserState {
  public token = getToken() || ''
  public name = ''
  public avatar = ''
  public introduction = ''
  public roles: string[] = []
  public email = ''

  @Mutation
  private SET_TOKEN(token: string) {
    this.token = token
  }

  @Mutation
  private SET_NAME(name: string) {
    this.name = name

vuex-module-decorators

Decorators to make class-like Vuex modules

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular vuex-module-decorators functions