提交 e684e9df 编写于 作者: E eliver_

Auto Commit

上级 79c5bd79
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
</script>
<template> <template>
<header> <el-config-provider :locale="locale">
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" /> <el-table :data="tableData" border style="width: 100%">
<el-table-column prop="account" label="用户名" />
<div class="wrapper"> <el-table-column prop="createTime" label="注册时间" />
<HelloWorld msg="You did it!" /> <el-table-column prop="level" label="等级" />
</div> </el-table>
</header> <el-pagination
v-model:currentPage="currentPage"
<main> :page-sizes="[5, 10]"
<TheWelcome /> :page-size="pageSize"
</main> layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></el-pagination>
</el-config-provider>
</template> </template>
<script>
<style scoped> import locale from 'element-plus/lib/locale/lang/zh-cn'
header { const data = Array.from(Array(114), (v, i) => {
line-height: 1.5; return {
} account: "uaa" + (i + 1),
createTime: new Date(Date.now() + Math.ceil(Math.random() * 1000)),
.logo { level: Math.ceil(Math.random() * 10)
display: block;
margin: 0 auto 2rem;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
} }
})
export default {
name: "App",
data() {
return {
locale,
currentPage: 1,
pageSize: 5,
total: 0,
tableData: []
};
},
created() {
this.getData(1, this.pageSize);
},
methods: {
handleSizeChange(val) {
this.pageSize = val;
this.getData(this.currentPage, val);
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData(val, this.pageSize);
},
getData(page, pageSize) {
this.tableData = data.slice((page - 1) * pageSize, page * pageSize);
this.total = data.length;
}
},
};
</script>
header .wrapper { <style>
display: flex; #app {
place-items: flex-start; font-family: Avenir, Helvetica, Arial, sans-serif;
flex-wrap: wrap; -webkit-font-smoothing: antialiased;
} -moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
} }
</style> </style>
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/main.css' createApp(App).use(ElementPlus).mount('#app')
createApp(App).mount('#app')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册