Files
HTFX-CRM-Sales/components/CopyIcon/CopyIcon.vue

41 lines
712 B
Vue
Raw Normal View History

2025-07-07 16:05:18 +08:00
<template>
<image :style="{ width: size + 'px', height: size + 'px', flexShrink: 0 }" src="/static/copy.svg" mode="aspectFit" @click="handleCopy"></image>
</template>
<script>
export default {
name: 'CopyIcon',
props: {
value: {
type: String,
required: false,
default: ''
},
size: {
type: Number,
required: false,
default: 14
}
},
methods: {
handleCopy() {
const that = this;
uni.setClipboardData({
data: this.value.toString(),
success: function () {
uni.showToast({
title: that.$t('common.success.copy'),
icon: 'success',
duration: 2000
});
}
});
}
}
};
</script>
<style lang="scss" scoped>
@import './index.scss';
</style>