You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-cmd

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-cmd

A Vue plugin that looks like Spotlight, Alfred, or Slack.

0.0.3
latest
npmnpm
Version published
Maintainers
1
Created
Source

vue-cmd

A Vue plugin that looks like Spotlight, Alfred, or Slack.

Installation

# use yarn
yarn add vue-cmd

# use npm
npm install --save vue-cmd

Usage

/* main.js */
import Vue from 'vue'
import Cmd from 'vue-cmd'     // <== import it
import App from './App.vue'

Vue.use(Cmd)                  // <== and use

new Vue({
  el: '#app',
  template: '<App/>',
  components: { App }
})
<!-- App.vue -->
<template>
  <div id="app">
    <!-- Invoke the handler, that’s it! -->
    <button @click="$openCmd(options)">Click to bring it up.</button>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        options: {
          data: [
            { text: 'example.com',  status: 'safe',    type: 'html',    link: '#/example'  },
            { text: 'sample.com',   status: 'warning', type: 'html',    link: '#/sample'   },
            { text: 'vuejs.org',    status: 'safe',    type: 'vue',     link: '#/vuejs'    },
            { text: 'facebook.com', status: 'danger',  type: 'react',   link: '#/facebook' },
            { text: 'google.com',   status: 'warning', type: 'angular', link: '#/google'   },
            { text: 'apple.com',    status: 'safe',    type: 'html',    link: '#/apple'    }
          ],
          commands: ['status', 'type'],
          render (h, params) => (
            <a class="item" href={params.link}>
              <span class={`item-status--${params.status}`}></span>
              <span>{params.text}</span>
              <span class="item-type">{params.type}</span>
            </a>
          )
        }
      }
    }
  }
</script>

FAQs

Package last updated on 04 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts