generated from yzITI/template-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Phantomlsh
committed
Mar 8, 2024
1 parent
5dc5ddc
commit bab908f
Showing
11 changed files
with
61 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
dist | ||
dist-ssr | ||
*.local | ||
package-lock.json | ||
pnpm-lock.yaml | ||
package-lock.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<script setup> | ||
import { I } from '../utils/string.js' | ||
const props = defineProps(['i', 'form', 'state']) | ||
let block = $computed(() => props.form[props.i]) | ||
</script> | ||
|
||
<template> | ||
<label> | ||
<span>{{ block.label }}</span> | ||
<input class="mx-2 border rounded px-2 py-1" :type="block.type" :placeholder="block.placeholder" v-model="props.state[block.key]"> | ||
<span>{{ I(block.label) }}</span> | ||
<input class="mx-2 border rounded px-2 py-1" :type="block.type" :placeholder="I(block.placeholder)" v-model="props.state[block.key]"> | ||
</label> | ||
<p class="text-xs text-gray-500">{{ block.hint }}</p> | ||
<p class="text-xs text-gray-500">{{ I(block.hint) }}</p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
<script setup> | ||
import { I } from '../utils/string.js' | ||
const props = defineProps(['i', 'form', 'state']) | ||
let block = $computed(() => props.form[props.i]) | ||
</script> | ||
|
||
<template> | ||
<label> | ||
<span :class="block.multiple ? 'block' : 'inline'">{{ block.label }}</span> | ||
<span :class="block.multiple ? 'block' : 'inline'">{{ I(block.label) }}</span> | ||
<select class="border rounded text-left" :class="block.multiple ? 'overflow-auto w-full my-2' : 'mx-2 px-2 py-1'" v-model="props.state[block.key]" :multiple="block.multiple" :size="block.multiple ? block.options.length : 1"> | ||
<option v-for="item in block.options">{{ item }}</option> | ||
</select> | ||
</label> | ||
<p class="text-xs text-gray-500">{{ block.hint }}</p> | ||
</template> | ||
<p class="text-xs text-gray-500">{{ I(block.hint) }}</p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<script setup> | ||
import { I } from '../utils/string.js' | ||
const props = defineProps(['i', 'form', 'state']) | ||
let block = $computed(() => props.form[props.i]) | ||
</script> | ||
|
||
<template> | ||
<label> | ||
<span class="block">{{ block.label }}</span> | ||
<p class="text-xs text-gray-500">{{ block.hint }}</p> | ||
<textarea class="my-2 border rounded px-2 py-1 w-full" :rows="block.rows" :placeholder="block.placeholder" v-model="props.state[block.key]"></textarea> | ||
<span class="block">{{ I(block.label) }}</span> | ||
<p class="text-xs text-gray-500">{{ I(block.hint) }}</p> | ||
<textarea class="my-2 border rounded px-2 py-1 w-full" :rows="block.rows" :placeholder="I(block.placeholder)" v-model="props.state[block.key]"></textarea> | ||
</label> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
<script setup> | ||
import { useRoute, useRouter } from 'vue-router' | ||
import { decodeJSON } from '../utils/crypto.js' | ||
import { state, SS } from '../state' | ||
import { state, login } from '../state' | ||
const route = useRoute(), router = useRouter() | ||
const token = route.query.token | ||
state.loading = true | ||
if (token) { | ||
state.user = decodeJSON(token.split('.')[1]) | ||
state.user.token = token | ||
SS.user = JSON.stringify(state.user) | ||
state.loading = false | ||
} | ||
router.push('/') | ||
if (login(token)) router.push('/home') | ||
else window.location.href = 'https://auth.njsc.ltd/#/launch/atool' | ||
</script> | ||
|
||
<template> | ||
<p class="p-3">Loading...</p> | ||
</template> |