This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Включить автопроигрывание хедера | |
// ЧПУ нормальное | |
// Тест на телефоне | |
// Google Map | |
var map; | |
var markers = []; | |
var iconBasis = '/wp-content/themes/m1_template/img/icons/marker.png'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<!-- https://forum.vuejs.org/t/recursive-scoped-slots/8220/6?u=michaelgitart --> | |
<wrapper> | |
<b-table v-bind="$attrs" v-on="$listeners"> | |
<!-- Pass on all named slots --> | |
<slot v-for="slot in Object.keys($slots)" :name="slot" :slot="slot"/> | |
<!-- Pass on all scoped slots --> | |
<template v-for="slot in Object.keys($scopedSlots)" :slot="slot" slot-scope="scope"><slot :name="slot" v-bind="scope"/></template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const debounce = (fn, ms) => { | |
let isCooldown = false | |
return function () { | |
if (isCooldown) { | |
return | |
} | |
// eslint-disable-next-line prefer-rest-params | |
fn.apply(this, arguments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
rules: { | |
'no-unused-vars': ['warn'], | |
'vue/no-unused-components': ['warn'], | |
'vue/component-name-in-template-casing': [ | |
'warn', | |
'PascalCase', | |
{ | |
registeredComponentsOnly: false, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<Component | |
:is="modal.component" | |
v-for="(modal, index) in dialogs" | |
:key="index" | |
:index="index" | |
v-bind="modal.props" | |
@close="onCloseModal(index)" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div | |
class="q-editor" | |
> | |
<div :id="holder" @change="onChange" /> | |
</div> | |
</template> | |
<script> | |
import EditorJS from '@editorjs/editorjs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import LANGUAGES from '~/constants/languages' | |
export function formatDate(string: string) { | |
const dateArray = string.split('-') | |
const date = dateArray[2].slice(0, 1) === '0' ? dateArray[2].slice(1, 1) : dateArray[2] | |
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |
return `${date} ${months[+dateArray[1] - 1]} ${dateArray[0]}` | |
} |