-
Notifications
You must be signed in to change notification settings - Fork 1
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
10 changed files
with
113 additions
and
45 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
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,40 +1,40 @@ | ||
<template> | ||
<h1>{{ msg }}</h1> | ||
<div class="hello-world"> | ||
<div><a href="https://vitejs.dev/guide/features.html" target="_blank">Vite Documentation</a></div> | ||
<div><a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a></div> | ||
<div><a href="https://element-plus.org/" target="_blank">Element Plus Documentation</a></div> | ||
|
||
<p> | ||
<a href="https://vitejs.dev/guide/features.html" target="_blank"> | ||
Vite Documentation | ||
</a> | ||
| | ||
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a> | ||
</p> | ||
<el-button @click="signOut" type="primary">signOut</el-button> | ||
<el-button @click="state.count++" type="primary">count is: {{ state.count }}</el-button> | ||
<n-button @click="state.count++" type="primary">count is: {{ state.count }}</n-button> | ||
|
||
<el-button @click="state.count++" type="primary">count is: {{ state.count }}</el-button> | ||
<n-button @click="state.count++" type="primary">count is: {{ state.count }}</n-button> | ||
<p> | ||
Edit | ||
<code>components/HelloWorld.vue</code> to test hot module replacement. | ||
</p> | ||
<div>打开<router-link to="/sign">Sign</router-link>页面,</div> | ||
<div>打开<router-link to="/user">User</router-link>页面,</div> | ||
<div>打开<router-link to="/admin">Admin</router-link>页面,如果是普通用户会被跳转到登录页面</div> | ||
|
||
<div> | ||
Edit<code>components/HelloWorld.vue</code> to test hot module replacement. | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { reactive } from 'vue'; | ||
import { signOut } from '@/utils/util'; | ||
export default { | ||
props: { | ||
msg: String, | ||
}, | ||
setup() { | ||
const state = reactive({ count: 0 }); | ||
return { | ||
state, | ||
signOut, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
a { | ||
color: #42b983; | ||
} | ||
<style lang="scss"> | ||
.hello-world { | ||
text-align: center; | ||
} | ||
</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
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,5 +1,30 @@ | ||
<template> | ||
<div class="about"> | ||
<div class="admin"> | ||
<h1>This is an admin page</h1> | ||
<div>{{users}}</div> | ||
<router-link to="/">Return Home</router-link> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
users: [], | ||
}; | ||
}, | ||
created() { | ||
this.getUserList(); | ||
}, | ||
methods: { | ||
async getUserList() { | ||
const users = await this.$api.user.list(); | ||
if (this.checkRes(users)) { | ||
this.users = users.data.data; | ||
} else { | ||
this.$error('获取用户列表失败'); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> |
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,6 +1,6 @@ | ||
<template> | ||
<div class="home"> | ||
<HelloWorld msg="helloworld"/> | ||
<HelloWorld/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<template> | ||
<div class="about"> | ||
<div class="user"> | ||
<h1>This is an user page</h1> | ||
{{ $user }} | ||
<router-link to="/">Return Home</router-link> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
computed: { | ||
$user() { | ||
return this.$router.$user; | ||
}, | ||
}, | ||
}; | ||
</script> |