2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00
Files
vue-select/docs/.vuepress/generateApiDocs/node/Slots.js
T

30 lines
588 B
JavaScript

module.exports = class Slots {
constructor (slots = {}) {
this.slots = slots;
}
add (name, slot) {
this.slots[name] = slot;
return this;
}
get definitions () {
return this.slots;
}
/**
* @return {*[]}
*/
get bindings () {
const normalizeBindings = bindings => {
return Object.values(bindings)
.map(binding => binding.replace(/ *\([^)]*\) */g, ''));
};
return Object
.values(this.slots)
.map(({bindings}) => normalizeBindings(bindings))
.reduce((store, bindings) => [...store, ...bindings], []);
}
};