ДМ
Size: a a a
ДМ
AG
AN
const myPlugin: Plugin = ({ $axios }, inject) => {
inject('api', {
acceptUserConfirmation(token: string, environment: string) {
return $axios.post(
`${
process.env.NUXT_ENV_URL}/api/
test/send`,
{ token, environment }
)
}
})
}
acceptUserConfirmation
acceptUserConfirmation
как unresolvedIB
V
const myPlugin: Plugin = ({ $axios }, inject) => {
inject('api', {
acceptUserConfirmation(token: string, environment: string) {
return $axios.post(
`${
process.env.NUXT_ENV_URL}/api/
test/send`,
{ token, environment }
)
}
})
}
acceptUserConfirmation
acceptUserConfirmation
как unresolvedV
AN
interface Api {
(token: string, environment: string): object
}
AN
AN
interface Api {
acceptUserConfirmation: object
}
V
interface Api {
(token: string, environment: string): object
}
acceptUserConfirmation: (token: string, enviroment: string) => Promise<???>
AN
acceptUserConfirmation: (token: string, enviroment: string) => Promise<???>
AN
acceptUserConfirmation: (token: string, enviroment: string) => Promise<???>
V
AN
import { Plugin } from '@nuxt/types'
interface Api {
acceptUserConfirmation: (token: string, enviroment: string) => Promise<any>
}
declare module 'vue/types/vue' {
// this.$api inside Vue components
interface Vue {
$api: Api
}
}
declare module '@nuxt/types' {
// nuxtContext.app.$api inside asyncData, fetch, plugins, middleware, nuxtServerInit
interface NuxtAppOptions {
$api: Api
}
// nuxtContext.$api
interface Context {
$api: Api
}
}
declare module 'vuex/types/index' {
// this.$api inside Vuex stores
interface Store<S> {
$api: Api
}
}
const myPlugin: Plugin = ({ $axios }, inject) => {
inject('api', {
acceptUserConfirmation(token: string, environment: string) {
return $axios.post(
`${
processprocess.env.NUXT_ENV_URL}/api/front/
test/send`,
{ token, environment }
)
}
})
}
export default myPlugin
V
import { Plugin } from '@nuxt/types'
interface Api {
acceptUserConfirmation: (token: string, enviroment: string) => Promise<any>
}
declare module 'vue/types/vue' {
// this.$api inside Vue components
interface Vue {
$api: Api
}
}
declare module '@nuxt/types' {
// nuxtContext.app.$api inside asyncData, fetch, plugins, middleware, nuxtServerInit
interface NuxtAppOptions {
$api: Api
}
// nuxtContext.$api
interface Context {
$api: Api
}
}
declare module 'vuex/types/index' {
// this.$api inside Vuex stores
interface Store<S> {
$api: Api
}
}
const myPlugin: Plugin = ({ $axios }, inject) => {
inject('api', {
acceptUserConfirmation(token: string, environment: string) {
return $axios.post(
`${
processprocess.env.NUXT_ENV_URL}/api/front/
test/send`,
{ token, environment }
)
}
})
}
export default myPlugin
AN
this.$api.acceptUserConfirmation('12', '21')
есть, не понятно, чего ему не хватаетAN
V
AN
᠌