feat: add custom address (#13)

* feat: add custom address

* feat: update readme
This commit is contained in:
Dream Hunter
2023-09-07 13:21:36 +08:00
committed by GitHub
parent a6b29073f5
commit 536cd98df2
6 changed files with 106 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
<script setup>
import { NMessageProvider, NGrid, NBackTop, NLayoutHeader, NInput } from 'naive-ui'
import { NGi, NSpace, NButton, NConfigProvider, NSelect, NModal } from 'naive-ui'
import { darkTheme, NSwitch, NGlobalStyle } from 'naive-ui'
import { darkTheme, NSwitch, NGlobalStyle, NPopconfirm } from 'naive-ui'
import { computed, ref } from 'vue'
import { useStorage } from '@vueuse/core'
@@ -17,6 +17,10 @@ const login = () => {
jwt.value = password.value;
location.reload()
}
const logout = () => {
jwt.value = '';
location.reload()
}
</script>
<template>
@@ -41,7 +45,17 @@ const login = () => {
Light
</template>
</n-switch>
<n-button tertiary @click="showLogin = true" round type="primary">
<n-popconfirm v-if="jwt" @positive-click="logout">
<template #trigger>
<n-button tertiary round type="primary">
Logout
</n-button>
</template>
<template #default>
<span>Are you sure to logout?</span>
</template>
</n-popconfirm>
<n-button v-else tertiary @click="showLogin = true" round type="primary">
Login
</n-button>
<n-button tag="a" target="_blank" tertiary type="primary" round