0.1.0 • Published 2 years ago

vue-hostmap v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

图片热区点击

基于 vue-hotzone 二次定制

Install

npm install vue-hotmap --save
# or
yarn add vue-hotmap

Use

// Use in component
import hotmap from 'vue-hotmap'

export default {
  components: {
    hotmap
  }
}

// Use in global
import hotmap from 'vue-hotmap'

Vue.component(hotmap.name, hotmap)

// or
Vue.use(hotmap)
<hotmap [options]></hotmap>

Options

Attributes

You can set them to your data function

AttributeTypeDescriptionKeys
imageStringimage of hotzone(required: true)
maxNumbermax number of zones
zonesInitArrayinit zonesitem(heightPer, leftPer, topPer, widthPer)

Events

Event NameDescriptionParameters
changetriggers when the zones changesthe array of the zones
addtriggers when the zone addthe add zone item
removetriggers when the zone removethe index of the remove zone
overRangetriggers when zones number > maxthe index of the overRange zone
erasetriggers when add zone overRange or smaller than the minimum area(48*48)the index of the erase zone

License

MIT

0.1.0

2 years ago