0.0.1 • Published 3 years ago

vue2-hotzone v0.0.1

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

Introduction

这是个修改后的版本,原仓库地址为vue-hotzone.

Install

npm i vue2-hotzone --save
# or
yarn add vue2-hotzone

Use

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

export default {
  components: {
    hotzone
  }
}

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

$ yarn serve

License

Vue-hotzone is MIT licensed.