vue-hotspot
Hotspot component for Vue.js.
Last updated a month ago by cn-wx .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-hotspot 
SYNC missed versions from official npm registry.

Vue travis-ci Coverage Status npm License GitHub code size in bytes Version

English | 简体中文

Introduction

Vue-Hotspot is an image hotspot component for Vue.js.

Installation

npm (Recommended)

$ npm install vue-hotspot --save

yarn

$ yarn add vue-hotspot

Usage

ES Modules with npm (Recommended)

import Vue from 'vue'
import VueHotspot from 'vue-hotspot' // refers to components/VueHotspot.vue in webpack

// register component to use
Vue.component('v-hotspot', VueHotspot)

Global variable

Without any module system, the component is exposed as window.VueHotspot.

// register component to use
Vue.component('v-hotspot', VueHotspot)

Using the component

<template>
  <v-hotspot
    :init-options="hotspotConfig"
    @save-data="saveData"
    @after-delete="afterDelete" />
</template>

<script>
import Vue from 'vue'
import VueHotspot from 'vue-hotspot'
export default {
  components: {
    'v-hotspot': VueHotspot
  },
  data () {
    return {
      hotspotConfig: {
        image: 'your-image-url.png',
        editable: true,
        interactivity: 'hover'
      }
    }
  },
  methods: {
    saveData (data) {
      // Do something with the list of hotspots
      console.log(data)
    },
    afterDelete () {
      // Do something after delete
      console.log('Do something after delete ...')
    }
  }
}
</script>

Live Demo

You can see more examples here.

Local development

$ npm i
$ npm run serve

Open http://localhost:8080/ to see the demo.

Current Tags

  • 1.1.5                                ...           latest (a month ago)

12 Versions

  • 1.1.5                                ...           a month ago
  • 1.1.4                                ...           a month ago
  • 1.1.3                                ...           a month ago
  • 1.1.2                                ...           a month ago
  • 1.1.0                                ...           a month ago
  • 1.0.3                                ...           a month ago
  • 1.0.1                                ...           a month ago
  • 1.0.0                                ...           a month ago
  • 0.1.3                                ...           2 months ago
  • 0.1.2                                ...           2 months ago
  • 0.1.1                                ...           2 months ago
  • 0.1.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 0
Last Month 229
Dependencies (8)
Dev Dependencies (18)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |