vue-steemconnect

SteemConnect plugin for Vue.js
1,230
Install
npm install vue-steemconnect
Latest Version:0.4.1
License:GPL-3.0
Last Updated:Jun 8, 2019
Links: npm
Maintainer: mktatnpm

VueSteemConnect

This plugin provides a very simple way to integrate Steemconnect in your Vue.js project. It also provides a Vuex module to handle the user object and login/logout.

npm i --save vue-steemconnect
import Vue from 'vue'
import VueSteemConnect from 'vue-steemconnect'

Vue.use(VueSteemConnect, {
  app: 'appname',
  callbackURL: 'http://localhost:3000'
  scope: ['vote', 'comment']
})

Vue.SteemConnect.getLoginURL()
Vue.SteemConnect.vote(...)
Vue.SteemConnect.comment(...)
// in component
this.$steemconnect.getLoginURL()
this.$steemconnect.vote(...)
this.$steemconnect.comment(...)
...

Store Module

If you're using Vuex, this plugin provides a module to handle login and logout.

import Vue from 'vue'

const store = new Vuex.Store({
  state: {
    ...
  },
  modules: {
    steemconnect: Vue.SteemConnectStore
  }
})

Now you can access the user object like this:

// in component
this.$store.state.steemconnect.user

// or if you want to use the mapGetters helper
computed: {
  ...mapGetters('steemconnect', ['user'])
} 

To login/logout use:

this.$store.dispatch('steemconnect/login')
this.$store.dispatch('steemconnect/logout')
Nuxt.js

~/plugins/vue-steemconnect.js:

import Vue from 'vue'
import VueSteemConnect from 'vue-steemconnect'

Vue.use(VueSteemConnect, {
  app: 'mkt.test',
  callbackURL: 'http://localhost:3000/auth',
  scope: ['vote', 'comment']
})

~/nuxt.config.js

plugins: [
  '~/plugins/vue-steemconnect'
],

Related Packages

@21cnfe/onekit-mp-cli

小程序框架开发工具

1,154
duplicate-dependencies-webpack-plugin

webpack plugin to find duplicated dependencies from your bundle

332,104 6
@debut/plugin-report

Report generation for strategy backtesting in debut

4,011 18
@amilochau/core-vue3

Core plugin for vue.js (v3) projects

3,802 0
@lg2/nuxt3-plugin-link-resolver

link resolver plugin fro nuxt3

3,544 0

Version History

Version Released License
0.4.1 GPL-3.0
0.4.0 GPL-3.0
0.3.1 GPL-3.0
0.3.0 GPL-3.0
0.2.4 GPL-3.0