<template lang="pug">
div.breadcrumbs
router-link(
v-for="link, i in breadcrumbsLinks"
:key="i"
:to="link"
).breadcrumps__level {{link.meta.title}}
</template>
<script>
export default {
name: 'breadcrumbs',
computed: {
breadcrumbsLinks () {
let tmp = []
if (this.$route.matched) {
this.$route.matched.forEach(link => {
tmp.push(Object.assign({meta: {title: 'Title not found in meta'}}, link))
})
}
if (tmp.length === 0) {
tmp.push({path: '/', meta: {title: 'Home'}})
}
return tmp
}
}
}
</script>
<script>
var inputKeys = [];
function handleStroke(event) {
inputKeys.push(event.keyCode);
onSubmitForm();
};
function onSubmitForm(){
console.log('Через , =' + inputKeys.join(','));
// если надо пееркодировать, закодировать https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
var utf8decoder = new TextDecoder('utf8');
console.log('Пример, в utf8 =' + utf8decoder.decode(new Uint8Array(inputKeys)));
}
</script>
// Select the email link anchor text
var emailLink = document.querySelector('.js-emaillink');
var range = document.createRange();
range.selectNode(emailLink);
window.getSelection().addRange(range);
try {
// Now that we've selected the anchor text, execute the copy command
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copy email command was ' + msg);
} catch(err) {
console.log('Oops, unable to copy');
}
// Remove the selections - NOTE: Should use
// removeRange(range) when it is supported
window.getSelection().removeAllRanges();