<template>
  <div ref="testCopy" class="test">
    <!-- @click="copyFunction" -->
    <input type="text" style="visibility: hidden;" autofocus @blur="copyFunction" />
    <!-- 点击 -->

    <cr-popover
      v-model="show"
      :action="[
        { text: 11111, icon: 'plus' },
        { text: 2222, disabled: true },
        { text: 2222, disabled: true }
      ]"
    >
      <!-- <template #default>helloword</template> -->
      <template #reference>
        <cr-button @click="show = true">
          展示弹出层
        </cr-button>
      </template>
    </cr-popover>
  </div>
</template>

<script>
import clipTextMixins from '@/mixins/clipText.mixins';
import { popover as CrPopover } from '@qg/cherry-ui';
export default {
  components: {
    CrPopover
  },
  mixins: [clipTextMixins],
  data() {
    return {
      show: false
    };
  },
  mounted() {},
  methods: {
    copyFunction() {
      const query = this.$route.query;
      this.setClipboardData({
        data: query.text,
        success: () => {
          this.$toast.success(`已复制---${query.text}`);
        }
      });
    }
  }
};
</script>
