Blogger Information
Blog 50
fans 0
comment 0
visits 31429
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
项目实战一
手机用户1580651468
Original
1113 people have browsed it

项目实战一

一、状态的实现

1.代码段

  1. <template #default="props">
  2. <span v-if="props.row.status==1">开启</span>
  3. <span v-if="props.row.status==0">关闭</span>
  4. </template>

2.可以在后台修改

  1. foreach($user as &$v){
  2. if($v['status'] == 1){
  3. $v['status_s'] ='开启';
  4. }else{
  5. $v['status_s'] ='关闭';
  6. }
  7. $v['time_add_s']=date('Y-m-d H:i:s',$v['time_add']);
  8. }

3.实现效果图

二、添加按钮

一)代码段

  1. <el-dialog
  2. v-model="sate.is_show"
  3. title="添加"
  4. width="30%"
  5. destroy-on-close
  6. align-center
  7. >
  8. <el-form :model="form" label-width="120px" size="large">
  9. <el-form-item label="账户">
  10. <el-input v-model="form.account" />
  11. </el-form-item>
  12. <el-form-item label="密码" >
  13. <el-input v-model="form.password" type="password" show-password/>
  14. </el-form-item>
  15. <el-form-item label="姓名">
  16. <el-input v-model="form.name" />
  17. </el-form-item>
  18. <el-form-item label="手机号">
  19. <el-input v-model="form.phone" />
  20. </el-form-item>
  21. <el-form-item label="QQ号">
  22. <el-input v-model="form.qq" />
  23. </el-form-item>
  24. <el-form-item label="状态">
  25. <el-select v-model="form.status" class="m-2" placeholder="Select" size="large">
  26. <el-option key="1" label="开启" :value="1"/>
  27. <el-option key="0" label="关闭" :value="0"/>
  28. </el-select>
  29. </el-form-item>
  30. </el-form>
  31. <template #footer>
  32. <span class="dialog-footer">
  33. <el-button size="large" @click="sate.is_show = false">取消</el-button>
  34. <el-button size="large" type="primary" @click="add_php()">
  35. 提交
  36. </el-button>
  37. </span>
  38. </template>
  39. </el-dialog>

二)实现的效果图

三、修改

一)代码

  1. <el-table-column label="操作">
  2. <template #default="props">
  3. <el-button type="primary" size="large" @click="addUser">修改</el-button>
  4. </template>
  5. </el-table-column>

二)修改的效果图

四、写一个公共模板

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments