How does the vue v-text instruction call the method that has been passed by import

for example, define a tag in template
< div class= "cg_table_row_fundname" > {{getShortTxtWithLength (item.fundname, 6)}} < / div >

The

getShortTxtWithLength method is introduced into the current component in the following ways
import {getShortTxtWithLength} from "src/utils/index.js";

but hint:

clipboard.png

how to use this method correctly?

Mar.02,2021

is it not possible to bind the function getShortTxtWithLength to vue.prototype?


declare this method again in methods, so that:

methods: {
    getShortTxtWithLength,
    // 
}

The

error message tells you that there is no such method under the vue object, so to use vue syntax sugar access, you must first mount the corresponding content to the vue object.

as said on the first floor, mount it into the methods method first so that you can access it through {{}}.

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-1b35c56-40fff.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-1b35c56-40fff.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?