zoukankan      html  css  js  c++  java
  • element ui表格 表头的的特殊处理(换行/jsx风格表头)以及上传组件的一点小问题

    <!--
     * @Description: 
     * @Version: 2.0
     * @Autor: lhl
     * @Date: 2020-01-15 11:15:40
     * @LastEditors: lhl
     * @LastEditTime: xxx
     -->
    <template>
      <div>
        <el-table :data="tableData" style=" 100%">
          <el-table-column align="center" label="Date" prop="date"></el-table-column>
          <el-table-column align="center" :label="'姓名
    (注:element ui 表格表头换行)'" prop="name"></el-table-column>
          <el-table-column align="center" :render-header="renderHeader">
            <template slot-scope="scope">
              <span>{{scope.row.address}}</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </template>
    
    <script>
    import child from "./child";
    export default {
      components: {
        child
      },
      data() {
        return {
          tableData: [
            {
              date: "2016-05-02",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1518 弄"
            },
            {
              date: "2016-05-04",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1517 弄"
            }
          ]
        };
      },
      mounted() {
    
      },
      created() {
        
      },
      methods: {
        renderHeader(h) {
          return (
            <div style="display: flex;justify-content: center;align-items: center;">
              <div>地址</div>
              <el-tooltip
                class="item"
                effect="dark"
                content="tooltip的使用。"
                placement="top"
              >
                <i class="el-icon-question"></i>
              </el-tooltip>
            </div>
          );
        }
      }
    };
    </script>
    
    <style lang="scss">
      .el-table .cell{
        white-space:pre-line;
      }
    </style>

     使用element-ui  el-upload上传图片,上传图片后再次打开还是会有原来的图片,想要清空原来上传的图片,只需要在组件上绑定 ref,在提交成功后的方法里调用 this.$refs.upload.clearFiles(); 就可以清除原来上传的文件;

  • 相关阅读:
    JVM调优--常用JVM监控工具使用
    jvm启动常用参数配置
    公钥和私钥原理
    tcp三次握手四次挥手
    内存泄漏和内存溢出
    hashmap解析
    Visual C++ 6.0 断点调试记录
    C++中输入一组不确定长度的数
    异或
    NULL与nullptr
  • 原文地址:https://www.cnblogs.com/lhl66/p/12843757.html
Copyright © 2011-2022 走看看