-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
119 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# English | ||
|
||
home: home | ||
about: about | ||
edit: Edit | ||
to test HMR: to test HMR | ||
check out: Check out | ||
The total number of views is: The total number of views is | ||
the official Tov + Vue + Vite template: the official Tov + Vue + Vite template |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 中文 | ||
|
||
home: 主页 | ||
about: 关于 | ||
edit: 编辑 | ||
to test HMR: 测试热更新 | ||
check out: 查看 | ||
The total number of views is: 总浏览数 | ||
the official Tov + Vue + Vite template: 公共的 Tov + Vue + Vite 模板 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script setup lang="ts"> | ||
import { vOnClickOutside } from '@vueuse/components' | ||
const visiable = ref(false) | ||
function dropdownHandler() { | ||
visiable.value = false | ||
} | ||
const { availableLocales, locale } = useI18n() | ||
</script> | ||
|
||
<template> | ||
<div class="relative"> | ||
<div class="inline-flex items-center overflow-hidden rounded-md"> | ||
<button | ||
class="h-full cursor-pointer border-0 bg-white p-2 text-gray-600 hover:bg-gray-200 hover:text-gray-700" | ||
dark="bg-transparent hover:bg-gray-500" | ||
:class="visiable ? 'bg-gray-200 bg-gray-500 dark:bg-gray-500' : ''" | ||
@click.stop="visiable = !visiable" | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-4 w-4" | ||
viewBox="0 0 20 20" | ||
fill="currentColor" | ||
> | ||
<path | ||
fill-rule="evenodd" | ||
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" | ||
clip-rule="evenodd" | ||
/> | ||
</svg> | ||
</button> | ||
</div> | ||
|
||
<Transition name="fade" mode="out-in"> | ||
<div | ||
v-if="visiable" | ||
v-on-click-outside.bubble="dropdownHandler" | ||
dark="bg-gray-500" | ||
class="absolute end-0 z-10 mt-2 w-56 border border-gray-100 rounded-md bg-white shadow-lg divide-y divide-gray-100" | ||
> | ||
<div class="p-2"> | ||
<span | ||
v-for="availableLocale of availableLocales" | ||
:key="availableLocale" | ||
:class=" | ||
locale === availableLocale | ||
? 'bg-gray-100 text-gray-800 dark:bg-gray-400' | ||
: '' | ||
" | ||
class="block cursor-pointer rounded-lg px-4 py-2 text-sm text-gray-500 hover:text-gray-900" | ||
dark="text-light-500 hover:text-light-900" | ||
@click="locale = availableLocale" | ||
> | ||
{{ availableLocale }} | ||
</span> | ||
</div> | ||
</div> | ||
</Transition> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters