UNPKG

veui

Version:

Baidu Enterprise UI for Vue.js.

43 lines (32 loc) 707 B
export default class BaseHandler { options = {} context = null isDragging = false constructor (options, context, vnode) { this.setOptions(options) this.context = context this.vnode = vnode } ready () {} start () { this.isDragging = true } drag () { throw new Error('`drag` method must be implemented.') } end () { this.isDragging = false } destroy () { throw new Error('`destroy` method must be implemented.') } setOptions (options) { if (this.isDragging) { throw new Error('Do not set `options` while dragging.') } this.options = options } reset () { throw new Error('`reset` method must be implemented.') } }