本文介绍了如何开始将AWS Amplify集成到Nuxt.js项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用vue和nuxt.我想将AWS后端添加到我的项目中.我已经看到Amplify很有用,但是还没有找到有关如何在nuxt中实现它的任何资源.有什么建议吗?

Im recently started working with vue and nuxt. I want to add an AWS backend to my project. I've seen that Amplify is useful but haven't been able to find any resources on how to implement it in nuxt. Any advice?

推荐答案

我正在尝试将AWS服务也实现为我正在开发的应用程序的后端.

I'm trying to implement as well AWS services as a backend for an app I'm working on.

通过以下步骤,我设法使用Nuxt应用程序进行了基本设置.

I managed to get a basic setup working with my Nuxt app doing the following steps.

1.-创建一个放大插件文件. (plugins/amplify.js)

1.- Create a Amplify Plugin File. (plugins/amplify.js)

import Vue from 'vue'
import Amplify, * as AmplifyModules from 'aws-amplify'
import { AmplifyPlugin, components } from 'aws-amplify-vue'
import aws_exports from '@/aws-exports'
Amplify.configure(aws_exports)

Vue.use(AmplifyPlugin, AmplifyModules)

//register components individually for further use
// Do not import in .vue files
Vue.component('sign-in', components.SignIn)

2.-将插件导入Nuxt Config.

2.- Import the plugin into the Nuxt Config.

plugins: [
    {
        src: '~plugins/amplify.js',
        ssr: false
    }
]

我将尝试进一步阐述,或者创建一个教程.希望对您有帮助!

I'll try and elaborate further or maybe create a tutorial. Hope it helps!

这篇关于如何开始将AWS Amplify集成到Nuxt.js项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 16:18