let x = 0
let y = 0
if (this.selectedWidgets.length) {
let maxRow = 0
this.selectedWidgets.forEach((selectedWidget) => {
if((selectedWidget.y + selectedWidget.h) >= maxRow)
maxRow = selectedWidget.y + selectedWidget.h
})
maxRow += 50
let matrix = Array.from({length: maxRow}, () =>
Array.from({length: this.colNum}, () => true)
);
for (let row = 0; row !== maxRow; row++) {
for (let col = 0; col !== this.colNum; col++) {
this.selectedWidgets.forEach(selectedWidget => {
if ((
col >= selectedWidget.x &&
col <= selectedWidget.x + selectedWidget.w - 1 &&
row >= selectedWidget.y &&
row <= selectedWidget.y + selectedWidget.h - 1
))
matrix[row][col] = false
})
}
}
let isDefined = false
for (let row = 0; row !== maxRow; row++) {
for (let col = 0; col !== this.colNum; col++) {
if (
matrix[row][col] &&
matrix[row][col + widget.w - 1] &&
matrix[row + widget.h][col] &&
matrix[row + widget.h][col + widget.w - 1]
) {
x = col
y = row
isDefined = true
break
}
}
if (isDefined)
break
}
}
extra_hosts:
- "host.docker.internal:host-gateway"
host all all 172.17.0.0/16 password
host all all 172.18.0.0/16 password
host all all 0.0.0.0/0 md5
listen_addresses = '*'
//в ModalInfo кроме слота больше ничего нет
import ModalInfo from '@/components/ModalInfo'
//...
let ComponentClass = Vue.extend(ModalInfo)
let tooltipInfo = new ComponentClass()
tooltipInfo.$slots.info = `
<span @click="${this.showInfo}">Ask Price</span>: ${params.value[0]}<br>
Duration: ${params.value[1]}
`;
tooltipInfo.$mount()
return tooltipInfo.$el
//...