Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private handleClick() {
if (this.credentials) {
clipboard
.writeText(this.credentials)
.then(() => {
const detail: SuccessDetail = { resourceLabel: this.resourceLabel };
this.success.emit(detail);
})
.catch(() => {
const message = 'couldn’t access clipboard';
const detail: ErrorDetail = { message, resourceLabel: this.resourceLabel };
this.error.emit(detail);
console.error(message);
});
}
}
.then((data) => {
const { btTracker } = data
const uri = getTaskUri(this.task, btTracker)
clipboard.writeText(uri)
.then(() => {
console.log(this.$t('copy-link-success'))
})
})
},
(_this.copyColor = function() {
var _this$state = _this.state,
color = _this$state.color,
currentFormat = _this$state.currentFormat
var activeColor = _this.getColor(color)[currentFormat]
clipboard.writeText(activeColor)
_this.setState({ showMsg: true })
}),
_temp)),
copyText () {
clipboard.writeText(this.text)
},
copyHtml () {
export function copyText (text) {
return clipboard.writeText(text)
.then(() => {
const shortText = short(text)
notice({ title: t('copy.copied'), body: text }, function () {
message.success(`${t('copy.copied')}: ${shortText}`, 0.7)
})
}, copyFailure)
}
copyColor = () => {
const { color, currentFormat } = this.state
const activeColor = this.getColor(color)[currentFormat]
clipboard.writeText(activeColor)
this.setState({ showMsg: true })
}
copyText () {
clipboard.writeText(this.text)
},
copyHtml () {
(_this.copyColor = function() {
clipboard.writeText(_this.state.color)
_this.setState({ showMsg: true })
}),
_temp)),
copy (text) {
clipboard.writeText(text)
this.$message({
message: `${text} 复制到剪贴板`,
type: 'success'
})
}
}
copyToClipboard(proof) {
clipboard
.writeText(proof)
.then(() => {
this.setState(
{
copied: true,
},
() => {
this.timeout = setTimeout(() => {
this.setState({ copied: false });
}, 2000);
}
);
})
.catch(() => {
this.setState({ copyFailed: true });
});