• 前端页面初步开发


    1. <template>
    2. <div>
    3. <el-card class="box-card" style="height: 620px">
    4. <el-input v-model="query.name" style="width:200px" placeholder="请输入用户姓名"></el-input>
    5. &nbsp
    6. &nbsp
    7. &nbsp
    8. <el-button type="primary">查询</el-button>
    9. &nbsp
    10. <el-button type="primary">新增</el-button>
    11. <el-table
    12. :data="tableData"
    13. height="250"
    14. border
    15. style="width: 100%">
    16. <el-table-column
    17. prop="id"
    18. label="ID"
    19. width="180">
    20. </el-table-column>
    21. <el-table-column
    22. prop="name"
    23. label="姓名"
    24. width="180">
    25. </el-table-column>
    26. <el-table-column
    27. prop="sex"
    28. label="性别">
    29. </el-table-column>
    30. <el-table-column
    31. prop="phone"
    32. label="手机号">
    33. </el-table-column>
    34. <el-table-column
    35. prop="avatar"
    36. label="头像">
    37. </el-table-column>
    38. <el-table-column label="操作">
    39. <template slot-scope="scope">
    40. <el-button
    41. size="mini"
    42. @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
    43. <el-button
    44. size="mini"
    45. type="danger"
    46. @click="handleDelete(scope.$index, scope.row)">删除</el-button>
    47. </template>
    48. </el-table-column>
    49. </el-table>
    50. <el-pagination
    51. @size-change="handleSizeChange"
    52. @current-change="handleCurrentChange"
    53. :current-page="currentPage4"
    54. :page-sizes="[5, 10, 20, 30]"
    55. :page-size="100"
    56. layout="total, sizes, prev, pager, next, jumper"
    57. :total="400">
    58. </el-pagination>
    59. </el-card>
    60. </div>
    61. </template>
    62. <script>
    63. export default {
    64. name: 'HomeView',
    65. data() {
    66. return {
    67. query: {
    68. page: 1,
    69. size: 5,
    70. name: '',
    71. },
    72. currentPage4: 4,
    73. tableData: [{
    74. id: '2023-10-01',
    75. name: '王小虎',
    76. sex: '男',
    77. phone: '18412345678',
    78. avatar: '鸡仔图.jpg',
    79. address: '河南省新乡市小店镇'
    80. }, {
    81. id: '2023-10-01',
    82. name: '王小虎',
    83. sex: '男',
    84. phone: '18412345678',
    85. avatar: '鸡仔图.jpg',
    86. address: '河南省新乡市小店镇'
    87. }, {
    88. id: '2023-10-01',
    89. name: '王小虎',
    90. sex: '男',
    91. phone: '18412345678',
    92. avatar: '鸡仔图.jpg',
    93. address: '河南省新乡市小店镇'
    94. }, {
    95. id: '2023-10-01',
    96. name: '王小虎',
    97. sex: '男',
    98. phone: '18412345678',
    99. avatar: '鸡仔图.jpg',
    100. address: '河南省新乡市小店镇'
    101. }, {
    102. id: '2023-10-01',
    103. name: '王小虎',
    104. sex: '男',
    105. phone: '18412345678',
    106. avatar: '鸡仔图.jpg',
    107. address: '河南省新乡市小店镇'
    108. }, {
    109. id: '2023-10-01',
    110. name: '王小虎',
    111. sex: '男',
    112. phone: '18412345678',
    113. avatar: '鸡仔图.jpg',
    114. address: '河南省新乡市小店镇'
    115. }, {
    116. id: '2023-10-01',
    117. name: '王小虎',
    118. sex: '男',
    119. phone: '18412345678',
    120. avatar: '鸡仔图.jpg',
    121. address: '河南省新乡市小店镇'
    122. }],
    123. }
    124. },
    125. methods: {
    126. handleEdit(index, row) {
    127. console.log(index, row);
    128. },
    129. handleDelete(index, row) {
    130. console.log(index, row);
    131. },
    132. handleSizeChange(val) {
    133. console.log(`每页 ${val} 条`);
    134. },
    135. handleCurrentChange(val) {
    136. console.log(`当前页: ${val}`);
    137. }
    138. }
    139. }
    140. </script>

    效果如下

  • 相关阅读:
    基于Linux和C++的socket编程示例(TCP)
    汽车行业“墨守成规”?VR全景助力车企打开新局面
    python r代表什么意思
    金仓数据库KingbaseES安全指南--3.1. 用户管理
    [HJ60 查找组成一个偶数最接近的两个素数]
    【附源码】计算机毕业设计JAVA药品管理系统演示录像 2021
    Arcgis聚合工具——实现简单的升尺度
    「Linux系列」Linux 如何学习用户和用户组管理
    【Spark基础编程】 第8章 Spark MLlib
    VXLAN详解
  • 原文地址:https://blog.csdn.net/m0_63732435/article/details/133458686