@abler/ats-vuex-plugin 中文文档教程
Vuex Plugin for Nuxt.js
用法示例
import { GetterTree, ActionTree, MutationTree } from 'vuex'
import Plugin, { IConfig } from '@abler/ats-vuex-plugin'
import { Audience } from '@abler/ats-front-resources-api/lib/support'
export const state = () => ({})
export const plugins = [Plugin]
export type RootState = ReturnType<typeof state>
export const getters: GetterTree<RootState, RootState> = {}
export const mutations: MutationTree<RootState> = {}
export const actions: ActionTree<RootState, RootState> = {
async nuxtServerInit ({ dispatch }, { req }) {
const config: IConfig = {
apiBaseURL: 'http://localhost:3000/api',
cookie: req.headers.cookie,
audience: Audience.CANDIDATE,
referrerSource: 'someSource',
hostname: '.localhost'
}
await dispatch('root/setConfig', config, { root: true })
}
}
Docs
Vuex Plugin for Nuxt.js
Example usage
import { GetterTree, ActionTree, MutationTree } from 'vuex'
import Plugin, { IConfig } from '@abler/ats-vuex-plugin'
import { Audience } from '@abler/ats-front-resources-api/lib/support'
export const state = () => ({})
export const plugins = [Plugin]
export type RootState = ReturnType<typeof state>
export const getters: GetterTree<RootState, RootState> = {}
export const mutations: MutationTree<RootState> = {}
export const actions: ActionTree<RootState, RootState> = {
async nuxtServerInit ({ dispatch }, { req }) {
const config: IConfig = {
apiBaseURL: 'http://localhost:3000/api',
cookie: req.headers.cookie,
audience: Audience.CANDIDATE,
referrerSource: 'someSource',
hostname: '.localhost'
}
await dispatch('root/setConfig', config, { root: true })
}
}
Docs
更多
你可能也喜欢
- 706-package 中文文档教程
- @0827v1_cli/core 中文文档教程
- @0x0006e/babel-preset-react-test 中文文档教程
- @11ty/eleventy-plugin-inclusive-language 中文文档教程
- @128technology/authenticate-pam-prebuilt 中文文档教程
- @20i/cognito-react 中文文档教程
- @20i/mrm-preset 中文文档教程
- @2sic.com/2sxc-typings 中文文档教程
- @4geit/rct-notification-store 中文文档教程
- @4react/errors 中文文档教程