-
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.
Merge pull request #7 from terwer/dev
feat:#1 Element-Plus ssr
- Loading branch information
Showing
16 changed files
with
1,279 additions
and
658 deletions.
There are no files selected for viewing
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
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,16 @@ | ||
html, | ||
body, | ||
#app { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
html.dark { | ||
background: #222; | ||
color: white; | ||
} | ||
|
||
a { | ||
font-weight: 400; | ||
color: var(--el-color-primary); | ||
} |
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,20 @@ | ||
<template> | ||
<el-input-number v-model="count" :min="1" :max="10"/> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import {ElInputNumber} from "element-plus"; | ||
import {useCount} from "~/composables/count"; | ||
const {count} = useCount(); | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: "Counter" | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
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,60 @@ | ||
<template> | ||
<el-button class="m-4" @click="hello">Hello</el-button> | ||
<el-button class="m-4" type="primary" @click="hello">Hello</el-button> | ||
<el-button class="m-4" type="success" @click="helloSuccess">Hello</el-button> | ||
|
||
<br /> | ||
|
||
<Counter class="m-4" /> | ||
|
||
<br /> | ||
|
||
<el-icon class="cursor-pointer"> | ||
<Grape /> | ||
</el-icon> | ||
<el-icon class="cursor-pointer"> | ||
<IceCream /> | ||
</el-icon> | ||
<el-icon class="cursor-pointer mb-4"> | ||
<IceDrink /> | ||
</el-icon> | ||
|
||
<br /> | ||
|
||
<client-only> | ||
<el-config-provider :locale="zhCn"> | ||
<el-date-picker | ||
v-model="timeValue" | ||
type="date" | ||
placeholder="请选择日期" | ||
></el-date-picker> | ||
</el-config-provider> | ||
</client-only> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { | ||
ElIcon, | ||
ElButton, | ||
ElConfigProvider, | ||
ElDatePicker, | ||
ElMessage, | ||
} from "element-plus"; | ||
import zhCn from "element-plus/es/locale/lang/zh-cn"; | ||
import { Grape, IceCream, IceDrink } from "@element-plus/icons-vue"; | ||
import {ref} from "vue"; | ||
const timeValue = ref(""); | ||
const hello = () => ElMessage.info("hello world"); | ||
const helloSuccess = () => ElMessage.success("hello world"); | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: "Examples" | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
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
File renamed without changes.
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,19 @@ | ||
<template> | ||
<Examples/> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import Examples from "~/components/Examples.vue"; | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: "Navbar", | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
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,16 @@ | ||
export function useCount() { | ||
const count = useState('count', () => Math.round(Math.random() * 20)) | ||
|
||
function inc() { | ||
count.value += 1 | ||
} | ||
function dec() { | ||
count.value -= 1 | ||
} | ||
|
||
return { | ||
count, | ||
inc, | ||
dec, | ||
} | ||
} |
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,22 +1,32 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"build": "nuxt build", | ||
"dev": "nuxt dev", | ||
"generate": "nuxt generate", | ||
"preview": "nuxt preview", | ||
"dev": "nuxi dev", | ||
"build": "nuxi build", | ||
"preview": "nuxi preview", | ||
"start": "node .output/server/index.mjs", | ||
"generate": "nuxi generate", | ||
"vdev": "vercel dev --listen 3000" | ||
}, | ||
"devDependencies": { | ||
"@pinia/nuxt": "^0.4.2", | ||
"@types/showdown": "^2.0.0", | ||
"@types/xmlrpc": "^1.3.7", | ||
"nuxt": "3.0.0-rc.8" | ||
"@unocss/nuxt": "^0.45.23", | ||
"@vueuse/nuxt": "^9.3.0", | ||
"nuxt": "3.0.0-rc.8", | ||
"sass": "^1.55.0", | ||
"typescript": "^4.8.3", | ||
"unplugin-element-plus": "^0.4.1", | ||
"vite": "^3.1.3" | ||
}, | ||
"dependencies": { | ||
"@element-plus/icons-vue": "^2.0.9", | ||
"arraybuffer-xml-parser": "^0.6.0", | ||
"element-plus": "^2.2.15", | ||
"pinia": "^2.0.22", | ||
"showdown": "^2.1.0", | ||
"vue": "^3.2.39", | ||
"xmlrpc": "^1.3.2" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { acceptHMRUpdate, defineStore } from "pinia"; | ||
|
||
export const useUserStore = defineStore("user", () => { | ||
/** | ||
* Current named of the user. | ||
*/ | ||
const savedName = ref(""); | ||
const previousNames = ref(new Set<string>()); | ||
|
||
const usedNames = computed(() => Array.from(previousNames.value)); | ||
const otherNames = computed(() => | ||
usedNames.value.filter((name) => name !== savedName.value) | ||
); | ||
|
||
/** | ||
* Changes the current name of the user and saves the one that was used | ||
* before. | ||
* | ||
* @param name - new name to set | ||
*/ | ||
function setNewName(name: string) { | ||
if (savedName.value) previousNames.value.add(savedName.value); | ||
|
||
savedName.value = name; | ||
} | ||
|
||
return { | ||
setNewName, | ||
otherNames, | ||
savedName, | ||
}; | ||
}); | ||
|
||
if (import.meta.hot) | ||
import.meta.hot.accept(acceptHMRUpdate(useUserStore, import.meta.hot)); |
Oops, something went wrong.
86048d7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
jvue-front – ./
jvue-front.vercel.app
jvue-front-git-main-terwergreen.vercel.app
jvue-front-terwergreen.vercel.app