欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Vue render渲染時(shí)間戳轉(zhuǎn)時(shí)間,時(shí)間轉(zhuǎn)時(shí)間戳及渲染進(jìn)度條效果

 更新時(shí)間:2018年07月27日 09:11:50   作者:分享是總結(jié)學(xué)習(xí)的一種好方法  
這篇文章主要介紹了Vue render渲染時(shí)間戳轉(zhuǎn)時(shí)間,時(shí)間轉(zhuǎn)時(shí)間戳及渲染進(jìn)度條效果,通過實(shí)例代碼相結(jié)合的形式給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

一.格式化時(shí)間

效果圖:

time

實(shí)現(xiàn)上述界面代碼如下:

data() {
   return {
    loading: false,
    demandData: [],
    demandcount: 0,//總條數(shù)
    skip: 0, //分頁
    pageSize: this.LIMIT,
    columns: [
     {
      title: '編號(hào)',
      width: 60,
      align: 'center',
      type: 'index'
     },
     {
      title: '標(biāo)簽名稱',
      key: 'd_title'
     },
     {
      title: '創(chuàng)建者',
      key: 'd_create_user'
     },
     {
      title: '內(nèi)容描述',
      key: 'd_content',
      width: "20%"
     },
     {
      title: '創(chuàng)建時(shí)間',
      key: 'd_create_time',
      render: (h, params) => {
       const row = params.row;
       return h('div', [
        h('span', {}, this.timeStamp(row.d_create_time)),
       ]);
      }
     },
     {
      title: '修改時(shí)間',
      key: 'd_change_times'
     },
     {
      title: '完成進(jìn)度',
      key: 'd_progress',
      render: (h, params) => {
       return h('div',[
        h('Progress', {
         props: {
          type: 'Progress',
          size: 'small',
          percent:parseInt(params.row.d_progress)
         }
        }, params.row.d_progress+'%'),])
      }
     },
     {
      title: '操作',
      key: 'operation',
      align: 'center',
      render: (h, params) => {
       return h('div', [
        h('Button', {
         props: {
          type: 'primary',
          size: 'small'
         },
         style: {
          marginRight: '5px'
         },
         on: {
          click: () => {
           console.log(params);
           // this.$router.push({path: '/xxxx', query: {fc_id: params.row.fc_id}});
           alert(1)
          }
         }
        }, '分配'),
        h('Button', {
         props: {
          type: 'primary',
          size: 'small'
         },
         style: {
          marginRight: '5px'
         },
         on: {
          click: () => {
           console.log(params);
           alert(2)
          }
         }
        }, '編輯'),
        h('Button', {
         props: {
          type: 'primary',
          size: 'small'
         },
         style: {
          marginRight: '5px'
         },
         on: {
          click: () => {
           console.log(params);
           // this.$router.push({path: '/xxxx', query: {fc_id: params.row.fc_id}});
           alert(3)
          }
         }
        }, '備注'),
        h('Button', {
         props: {
          type: 'primary',
          size: 'small'
         },
         style: {
          marginRight: '0px'
         },
         on: {
          click: () => {
           console.log(params);
           // this.$router.push({path: '/xxxx', query: {fc_id: params.row.fc_id}});
           alert(4)
          }
         }
        }, '修改')
       ]);
      }
     }
    ]
   }
  },

數(shù)據(jù)表:

data

顯示時(shí)間具體代碼:

 {
      title: '創(chuàng)建時(shí)間',
      key: 'd_create_time',
      render: (h, params) => {
       const row = params.row;
       return h('div', [
        h('span', {}, this.timeStamp(row.d_create_time)),
       ]);
      }
     }

時(shí)間轉(zhuǎn)化工具類:

//時(shí)間戳轉(zhuǎn)時(shí)間
  Vue.prototype.timeStamp = function (time) {
   var date = new Date(time * 1000);
   var Y = date.getFullYear() + '-';
   var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
   var D = date.getDate() + ' ';
   var h = date.getHours() + ':';
   var m = date.getMinutes() + ':';
   var s = date.getSeconds();
   if(D < 10){
    D = "0" + D;
   }
   return Y + M + D
  }
  //時(shí)間轉(zhuǎn)時(shí)間戳
  Vue.prototype.time = function (index) {
   var strtime = index;
   var date = new Date(strtime);
   var time = Date.parse(date) / 1000;
   return time
  }

二.進(jìn)度條:

 {
      title: '完成進(jìn)度',
      key: 'd_progress',
      render: (h, params) => {
       return h('div',[
        h('Progress', {
         props: {
          type: 'Progress',
          size: 'small',
          percent:parseInt(params.row.d_progress)
         }
        }, params.row.d_progress+'%'),])
      }
     }

其他具體界面實(shí)現(xiàn)請查看:https://www.iviewui.com/components/table

總結(jié)

以上所述是小編給大家介紹的Vue render渲染時(shí)間戳轉(zhuǎn)時(shí)間,時(shí)間轉(zhuǎn)時(shí)間戳及渲染進(jìn)度條效果,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • vue3中實(shí)現(xiàn)異步組件的方法實(shí)例

    vue3中實(shí)現(xiàn)異步組件的方法實(shí)例

    前端開發(fā)經(jīng)常遇到異步的問題,請求函數(shù)、鏈接庫等,下面這篇文章主要給大家介紹了關(guān)于vue3中實(shí)現(xiàn)異步組件的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-06-06
  • Vue中的前端crypto.js加解密

    Vue中的前端crypto.js加解密

    這篇文章主要介紹了Vue中的前端crypto.js加解密問題,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-12-12
  • vue遮罩層如何阻止?jié)L動(dòng)

    vue遮罩層如何阻止?jié)L動(dòng)

    這篇文章主要介紹了vue遮罩層如何阻止?jié)L動(dòng),具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-07-07
  • vue3數(shù)組或?qū)ο筚x值不更新解決方法示例

    vue3數(shù)組或?qū)ο筚x值不更新解決方法示例

    這篇文章主要為大家介紹了vue3數(shù)組或?qū)ο筚x值不更新解決方法示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-11-11
  • Ant Design Upload 文件上傳功能的實(shí)現(xiàn)

    Ant Design Upload 文件上傳功能的實(shí)現(xiàn)

    這篇文章主要介紹了Ant Design Upload 文件上傳功能的實(shí)現(xiàn)方式,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-04-04
  • Vue出現(xiàn)did you register the component correctly?解決方案

    Vue出現(xiàn)did you register the component 

    這篇文章主要介紹了Vue出現(xiàn)did you register the component correctly?解決方案,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • vue動(dòng)態(tài)生成dom并且自動(dòng)綁定事件

    vue動(dòng)態(tài)生成dom并且自動(dòng)綁定事件

    本篇文章主要介紹了vue動(dòng)態(tài)生成dom并且自動(dòng)綁定事件,具有一定的參考價(jià)值,有興趣的可以了解一下。
    2017-04-04
  • windows下vue-cli導(dǎo)入bootstrap樣式

    windows下vue-cli導(dǎo)入bootstrap樣式

    這篇文章主要介紹了windows下vue-cli導(dǎo)入bootstrap樣式,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-04-04
  • Vue3中provide和inject作用和場景

    Vue3中provide和inject作用和場景

    Vue3中provide和inject作用和場景是頂層組件向任意的底層組件傳遞數(shù)據(jù)和方法,實(shí)現(xiàn)跨層組件通信,本文通過實(shí)例介紹Vue3 provide和inject的相關(guān)知識(shí),感興趣的朋友一起看看吧
    2023-11-11
  • Vue是怎么渲染template內(nèi)的標(biāo)簽內(nèi)容的

    Vue是怎么渲染template內(nèi)的標(biāo)簽內(nèi)容的

    這篇文章主要介紹了Vue是怎么渲染template內(nèi)的標(biāo)簽內(nèi)容的,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-06-06

最新評(píng)論