Vue CLI v3.11.0 ? Please pick a preset: default (babel, eslint) ❯ Manually select features
1 2 3 4 5 6 7 8 9 10 11
? Please pick a preset: Manually select features ? Check the features needed for your project: ◉ Babel ◯ TypeScript ◯ Progressive Web App (PWA) Support ◉ Router ❯◉ Vuex ◯ CSS Pre-processors ◉ Linter / Formatter ◯ Unit Testing ◯ E2E Testing
Note: It is recommended to run this command from the root of your app directory ? Enter a name for the project amplify-sample ? Enter a name for the environment dev ? Choose your default editor: Visual Studio Code ? Choose the type of app that you're building javascript Please tell us about your project ? What javascript framework are you using vue ? Source Directory Path: src ? Distribution Directory Path: dist ? Build Command: npm run-script build ? Start Command: npm run-script serve
中途可能会出现让你选择环境的选项? Enter a name for the environment 可以先输入dev
1
? Do you want to use an AWS profile? (Y/n) Y
追加认证
给Project追加认证
1
$ amplify add auth
1 2 3 4 5 6 7 8 9
Using service: Cognito, provided by: awscloudformation
The current configured provider is Amazon Cognito.
Do you want to use the default authentication and security configuration? (Use arrow keys) ❯ Default configuration Default configuration with Social Provider (Federation) Manual configuration I want to learn more.
import Vue from 'vue' import App from './App.vue' import router from './router' import store from './store'
import Amplify, * as AmplifyModules from 'aws-amplify' import { AmplifyPlugin } from 'aws-amplify-vue' import awsconfig from './aws-exports' Amplify.configure(awsconfig)
Vue.use(AmplifyPlugin, AmplifyModules)
Vue.config.productionTip = false
new Vue({ router, store, render: h => h(App) }).$mount('#app')