0.3.2 • Published 1 year ago

vue2-hotmap v0.3.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

图片热区点击

基于 vue-hotzone 二次定制

Install

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

Use

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

export default {
  components: {
    hotmap
  }
}

// Use in global
import hotmap from 'vue2-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.3.2

1 year ago

0.3.1

1 year ago

0.1.0

1 year ago