<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
<style>
html,
body {
font-family: "Montserrat", Helvetica, Arial, Verdana, Tahoma, sans-serif !important;
}
</style>
{{ HEAD }}
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
{% if (ENV.NODE_ENV === 'production') { %}
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m, e, t, r, i, k, a) {
m[i] = m[i] || function() {
(m[i].a = m[i].a || []).push(arguments)
};
m[i].l = 1 * new Date();
k = e.createElement(t), a = e.getElementsByTagName(t)[0], k.async = 1, k.src = r, a.parentNode.insertBefore(k, a)
})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(66856768, "init", {
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true
});
</script>
<noscript>
<div>
<img src="https://mc.yandex.ru/watch/66856768" style="position:absolute; left:-9999px;" alt="" />
</div>
</noscript>
<!-- /Yandex.Metrika counter -->
{% } %}
</body>
</html>
const router = new Router({
mode: 'history',
base: '/dash/vue/',
routes: [{
path: '/home',
alias: '/',
name: 'home'.
component: HomePage
}, {
name: 'test',
path: '/test',
component: TestPage
}]
})
:/dash/vue/**/*
отдавать всегда index.html
const path = require('path')
module.exports = {
resolve: {
extensions: ['.js', '.json', '.vue', '.ts'],
root: path.resolve(__dirname),
alias: {
'@': path.resolve(__dirname),
'~': path.resolve(__dirname),
},
},
}
let onscreen = {
bind(el, options) {
let className = options.value;
let deleteClass = options.arg === "delete";
window.addEventListener("scroll", this.action);
},
unbind() {
window.removeEventListener("scroll", this.action);
},
action() {
if (isVisible(el)) {
if (deleteClass) {
el.classList.remove(className)
} else {
el.classList.add(className)
}
} else {
if (deleteClass) {
el.classList.add(className)
} else {
el.classList.remove(className)
}
}
}
};
Но как снять эту прослушку потом в unbind?
bind(el, options) {
const handler = () => { ... };
window.addEventListener('scroll', handler);
el.scrollHandler = handler;
},
unbind(el) {
window.removeEventListener('scroll', el.scrollHandler);
},
const map = new Map();
window.addEventListener('scroll', function(e) {
[...map.entries()].forEach(([ el, { className, deleteClass } ]) => {
...
});
});
bind(el, options) {
map.set(el, {
className: options.value,
deleteClass: options.arg === 'delete',
});
},
unbind(el) {
map.delete(el);
},
SELECT o.*, b.earned AS booster_earned, u.username AS booster_name, r.id AS review_id
FROM orders AS o
INNER JOIN booster_info AS b ON o.booster_id = b.booster_id
INNER JOIN users AS u ON o.booster_id = u.id
LEFT JOIN reviews AS r ON o.order_id = r.order_id
WHERE o.order_status='5'