<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                > 使用element-table的時候,工作中遇到后臺給的表格數據里時間是一個13位的時間戳,需要轉換成時間顯示在表格里,可以用element-ui表格自帶的:formatter函數,來格式化表格內容: 1. 新建一個js文件用來轉換時間戳 ``` export function timeFormat(data) { // 返回年月日時分秒 if (data) { const date = new Date(data) const year = date.getFullYear() const month = (date.getMonth() + 1) > 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1) const day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate() const hour = date.getHours() > 9 ? date.getHours() : '0' + date.getHours() const minutes = date.getMinutes() > 9 ? date.getMinutes() : '0' + date.getMinutes() const seconds = date.getSeconds() > 9 ? date.getSeconds() : '0' + date.getSeconds() return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds } } export function timeMonth(data) { // 返回年月日 if (data) { const date = new Date(data) const year = date.getFullYear() const month = (date.getMonth() + 1) > 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1) const day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate() return year + '-' + month + '-' + day } } ``` 2. 在HTML位置 ``` <el-table border > <el-table-column lable="時間" prop="createTime" :formatter="formatTime"></el-table-column> </el-table> ``` ``` <!-- 引入js --> import { timeMonth } from "@/utils/timeFormat.js"; methods : { formatTime(row, col, val) { // 表格時間格式化 return timeMonth(val); // 顯示為年月日 ????}, } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看