1.1.0 • Published 6 years ago

vue-hotzone v1.1.0

Weekly downloads
9
License
MIT
Repository
-
Last release
6 years ago

vue-hotzone

A vue2 hotzone component

NPM

Demo | 案例

Install

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

Use

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

export default {
  components: {
    hotzone
  }
}

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

Vue.component(hotzone.name, hotzone)

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

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

Develop

git clone https://github.com/OrangeXC/vue-hotzone.git

cd vue-hotzone

yarn # or npm install

yarn serve # or npm run serve

License

MIT