this.map.on("zoomend", () => this.onZoomEnd(МАССИВ));
onZoomEnd(residentials) {
const { oldZoom } = this,
newZoom = this.map.getZoom();
const template =
oldZoom > this.switchOnZoom && newZoom <= this.switchOnZoom
? this.setMiniMarker
: oldZoom <= this.switchOnZoom && newZoom > this.switchOnZoom
? this.setZoomMarker
: null;
if (template) {
Object.values(this.markers._layers).forEach((marker, i) => {
marker._icon.innerHTML = template(residentials[i]);
});
}
}
const response = {
"id": "1",
"status": "1",
"name": "Администратор",
"rights": {
"orders.view": "1",
"orders.create": "1",
"orders.changeClosed": "0",
"main.managerList": "1",
"main.workerList": "1",
"finance.reports": "1",
"compendiums.counteragents": "1",
"compendiums.works": "1"
},
"error": {
"error_code": 0
}
};
const roleData = {
checkRights: []
};
const rights = Object.keys(response.rights).filter((key) => +response.rights[key] === 1);
roleData.checkRights = roleData.checkRights.concat(rights);
console.log(roleData);
export default {
name: 'App',
components: {
BkContener
},
data () {
return {
bookmarks: null
}
},
methods: {
getBookmarks(bookmarkTree) {
chrome.bookmarks.getTree((bookmarkTree) => {
console.log('bookmarks tree -> ' + bookmarkTree);
console.log(bookmarkTree);
this.bookmarks = bookmarkTree; // Угадал?
})
}
}
}
<div v-if="bookmarks">
<!-- Остальной темплейт -->
</div>
import pug from 'pug';
//...
template: pug.render(`span {{ tr(lang).title }} `)