Commit a4ca74e9ab87a233686442eb27b98ff839901af1
1 parent
5860e087
fix:DEFECT-858 复制Topic一次后,第二次就复制不上了
Showing
1 changed file
with
7 additions
and
6 deletions
| @@ -47,8 +47,8 @@ | @@ -47,8 +47,8 @@ | ||
| 47 | </div> | 47 | </div> |
| 48 | </BasicModal> | 48 | </BasicModal> |
| 49 | </div> | 49 | </div> |
| 50 | - <Description @register="register" class="mt-4" :data="deviceDetail" /> | ||
| 51 | - </div> | 50 | + <Description @register="register" class="mt-4" :data="deviceDetail" /> </div |
| 51 | + >设备Topic | ||
| 52 | <div class="mt-4"> | 52 | <div class="mt-4"> |
| 53 | <a-button type="primary" class="mr-4" @click="copyTbDeviceId">复制设备ID</a-button> | 53 | <a-button type="primary" class="mr-4" @click="copyTbDeviceId">复制设备ID</a-button> |
| 54 | <a-button type="primary" class="mr-4" @click="copyDeviceToken">复制访问令牌</a-button> | 54 | <a-button type="primary" class="mr-4" @click="copyDeviceToken">复制访问令牌</a-button> |
| @@ -75,6 +75,7 @@ | @@ -75,6 +75,7 @@ | ||
| 75 | import { Description, useDescription } from '/@/components/Description'; | 75 | import { Description, useDescription } from '/@/components/Description'; |
| 76 | import { QuestionCircleOutlined } from '@ant-design/icons-vue'; | 76 | import { QuestionCircleOutlined } from '@ant-design/icons-vue'; |
| 77 | import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; | 77 | import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; |
| 78 | + import { useClipboard } from '@vueuse/core'; | ||
| 78 | 79 | ||
| 79 | import wz from '/@/assets/images/wz.png'; | 80 | import wz from '/@/assets/images/wz.png'; |
| 80 | export default defineComponent({ | 81 | export default defineComponent({ |
| @@ -154,10 +155,10 @@ | @@ -154,10 +155,10 @@ | ||
| 154 | const token = await getDeviceToken(props.deviceDetail.tbDeviceId); | 155 | const token = await getDeviceToken(props.deviceDetail.tbDeviceId); |
| 155 | openModal(true, token); | 156 | openModal(true, token); |
| 156 | }; | 157 | }; |
| 157 | - const copyTopic = (value) => { | ||
| 158 | - clipboardRef.value = value; | ||
| 159 | - console.log(clipboardRef.value); | ||
| 160 | - createMessage.success('复制成功~'); | 158 | + const { copy } = useClipboard(); |
| 159 | + const copyTopic = (val) => { | ||
| 160 | + copy(val); | ||
| 161 | + createMessage.success('复制成功!'); | ||
| 161 | }; | 162 | }; |
| 162 | 163 | ||
| 163 | const [registerTopicModal, { openModal: openTopicModal }] = useModal(); | 164 | const [registerTopicModal, { openModal: openTopicModal }] = useModal(); |