提交 a16ef4e4 编写于 作者: View Design's avatar View Design

Update Create.vue

上级 dfadae95
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
/> />
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<UTooltip :text="isInternet ? '已接入互联网' : '不接入互联网'" :shortcuts="[metaSymbol, 'O']"> <UTooltip class="relative" :text="isPro ? '已开启专家搜索' : '已关闭专家搜索'" :shortcuts="[metaSymbol, 'O']">
<div class="absolute w-7 h-0.5 rotate-45 top-3.5 left-1 bg-gray-700 dark:bg-gray-200 hover:bg-gray-900 dark:hover:bg-white rounded" v-if="!isPro"></div>
<UButton <UButton
:ui="{ rounded: 'rounded-full' }" :ui="{ rounded: 'rounded-full' }"
:icon="isInternet ? 'i-heroicons-signal-20-solid' : 'i-heroicons-signal-slash-20-solid'" :icon="isPro ? 'i-heroicons-sparkles-20-solid' : 'i-heroicons-sparkles-20-solid'"
color="gray" color="gray"
variant="ghost" variant="ghost"
@click="handleToggleInternet" @click="handleTogglePro"
/> />
</UTooltip> </UTooltip>
<USelectMenu <USelectMenu
...@@ -33,12 +34,13 @@ ...@@ -33,12 +34,13 @@
value-attribute="label" value-attribute="label"
option-attribute="label" option-attribute="label"
> >
<UTooltip text="选择 GitHub 项目" v-if="!selectedRepo"> <UTooltip :text="isPro ? '选择 GitHub 项目' : '选择 GitHub 项目(需开启专家搜索)'" v-if="!selectedRepo">
<UButton <UButton
:ui="{ rounded: 'rounded-full' }" :ui="{ rounded: 'rounded-full' }"
icon="i-simple-icons-github" icon="i-simple-icons-github"
color="gray" color="gray"
variant="ghost" variant="ghost"
:disabled="!isPro"
/> />
</UTooltip> </UTooltip>
...@@ -90,7 +92,7 @@ const cardUI = { ...@@ -90,7 +92,7 @@ const cardUI = {
const menuUI = { const menuUI = {
width: 'w-auto' width: 'w-auto'
} }
const isInternet = ref(true) const isPro = ref(true)
const handleSearch = async () => { const handleSearch = async () => {
if (loading.value || query.value === '') return if (loading.value || query.value === '') return
...@@ -143,12 +145,13 @@ defineShortcuts({ ...@@ -143,12 +145,13 @@ defineShortcuts({
meta_o: { meta_o: {
usingInput: 'createInput', usingInput: 'createInput',
handler: () => { handler: () => {
handleToggleInternet() handleTogglePro()
} }
} }
}) })
function handleToggleInternet () { function handleTogglePro () {
isInternet.value = !isInternet.value isPro.value = !isPro.value
if (!isPro.value) handleClearRepo()
} }
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册