style: 抽离BaseButton,支持按钮修改主题色
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ContentWrap } from '@/components/ContentWrap'
|
||||
import { useClipboard } from '@/hooks/web/useClipboard'
|
||||
import { ElButton, ElInput } from 'element-plus'
|
||||
import { ElInput } from 'element-plus'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const { copy, copied, text, isSupported } = useClipboard()
|
||||
@@ -13,10 +13,10 @@ const source = ref('')
|
||||
<ContentWrap title="useClipboard">
|
||||
<ElInput v-model="source" placeholder="请输入要复制的内容" />
|
||||
<div v-if="isSupported">
|
||||
<ElButton @click="copy(source)" type="primary" class="mt-20px">
|
||||
<BaseButton @click="copy(source)" type="primary" class="mt-20px">
|
||||
<span v-if="!copied">复制</span>
|
||||
<span v-else>已复制</span>
|
||||
</ElButton>
|
||||
</BaseButton>
|
||||
<p>
|
||||
当前已复制: <code>{{ text || 'none' }}</code>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user