Hello, bosses, how to use the function of import in the vue template?

< meta charset= "utf-8" > < / meta >
< div id= "app" >

  :{{ message }} <!-- util.getDateTime() -->

< / div >

< script type= "text/javascript" >

import * as util from "@/libs/util"
//util getDateTime()
var app = new Vue({
      el: "-sharpapp",
      data: {
          message: "1541072778"
      }
)

< / script >

{{util.getDateTime (message)}} error message:

Nov.04,2021

{{getDateTime (modalInfo.order.dateline)}}
define a function in vue
getDateTime (dateline) {

    return util.getDateTime(dateline);
}

equals {{util.getDateTime (modalInfo.order.dateline)}}

current solution. I don't know if there is a more suitable

.

commonly used tool classes can be introduced in main.js, which is more convenient

Vue.prototype.$util = util

when using

{{$util.getDateTime()}}

this.$util.getDateTime()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b33157-40ea9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b33157-40ea9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?