history.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <el-table
  3. :data="historyData"
  4. size="mini"
  5. style="max-width:100%;"
  6. max-height="100%"
  7. ref="box"
  8. v-show="ishow"
  9. @row-click="backToClick"
  10. >
  11. <el-table-column
  12. prop="action"
  13. >
  14. <template slot="header">
  15. <p>历史记录
  16. <el-tag type="info" size="mini" class="panel-close-btn" @click="close">x</el-tag>
  17. </p>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. </template>
  22. <script>
  23. export default {
  24. methods: {
  25. close(){
  26. // 这边需至父组件修改
  27. this.ishow = false
  28. },
  29. backToClick(v){
  30. this.$store.commit('replaceEditorState', v)
  31. }
  32. },
  33. props: {
  34. historyData:Array,
  35. ishow:{
  36. type:Boolean,
  37. default:true
  38. }
  39. },
  40. data() {
  41. return {
  42. }
  43. },
  44. watch: {
  45. // historyData(){
  46. // console.log(this.$refs.box)
  47. // this.$refs.box.scrollTop = this.$refs.box.scrollHeight;
  48. // }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scope>
  53. .el-table .warning-row {
  54. background: oldlace;
  55. .el-table--scrollable-x .el-table__body-wrapper{
  56. overflow-x: hidden;
  57. }
  58. }
  59. .panel-close-btn{
  60. position: absolute;
  61. right: 0;
  62. }
  63. </style>