fix event embed filters + new clipboard mixin
This commit is contained in:
18
assets/clipboard.js
Normal file
18
assets/clipboard.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export default {
|
||||
methods: {
|
||||
clipboard (str, msg = 'common.copied') {
|
||||
try {
|
||||
navigator.clipboard.writeText(str)
|
||||
} catch (e) {
|
||||
const el = document.createElement('textarea')
|
||||
el.addEventListener('focusin', e => e.stopPropagation())
|
||||
el.value = str
|
||||
document.body.appendChild(el)
|
||||
el.select()
|
||||
document.execCommand('copy')
|
||||
document.body.removeChild(el)
|
||||
}
|
||||
this.$root.$message(msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,4 +120,9 @@ li {
|
||||
|
||||
.cursorPointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: break-spaces;
|
||||
font-size: 13px;
|
||||
}
|
||||
Reference in New Issue
Block a user