@vue-accounts/meteor

0.0.17-alpha.3 • Public • Published

Vue Accounts Meteor

Connects Vue Accounts to your Meteor application.

Getting Started

In your Meteor + Vue application, install the following dependencies

meteor npm install @vue-accounts/core @vue-accounts/meteor

Initialize the Vuex Store, add the core plugin to Vue and the Meteor module + plugin like below:

import Vue from 'vue';
import Vuex from 'vuex';

import { AccountStorePlugin } from '@vue-accounts/core';
import MeteorStore, { StorePlugin } from '@vue-accounts/meteor';

Vue.use(Vuex);

// Just the normal Vuex store module setup
const store = new Vuex.Store({ 
  plugins: [StorePlugin], 
  modules: {
    account: MeteorStore, 
  },
});

Vue.use(AccountStorePlugin, { store }); // Make sure that you pass the store here

export default store;

The store is now connected and ready to use from anywhere in your app.

Adding components

You can either build your own forms or use existing component extensions. Right now there is one available:

meteor npm install @vue-accounts/bare-components

This will make standard forms available for login, registration, forgot-password and reset password. Below is an example:

<template>
  <main>
    <TheHeader />
    <button @click="$logout" v-if="isLoggedIn">Logout</button>

    <login-form v-if="!isLoggedIn" />

    <registration-form />
  </main>
</template>

<script>
  import TheHeader from './components/TheHeader';
  import { LoginForm, RegistrationForm } from '@vue-accounts/bare-components';

  export default {
    components: {
      RegistrationForm,
      LoginForm,
      TheHeader,
    },
    computed: {
      isLoggedIn() {
        return this.$store.state.account.userId;
      }
    }
  };
</script>

A complete example can be found in the vue-accounts repo's examples directory.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.17-alpha.31latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.17-alpha.31
0.0.17-alpha.20
0.0.17-alpha.10
0.0.12-alpha.00
0.0.11-alpha.00
0.0.10-alpha.00
0.0.9-alpha.00
0.0.8-alpha.00

Package Sidebar

Install

npm i @vue-accounts/meteor

Weekly Downloads

0

Version

0.0.17-alpha.3

License

MIT

Unpacked Size

29.3 kB

Total Files

11

Last publish

Collaborators

  • cloudspider