Can vue declare a variable in the {{}} template for later use?

solution:

defines a temporary variable, but it needs to be hidden, otherwise it will be displayed

    <span v-show="false">
        {{message = chat.messages[chat.messages.length-1]}}
    </span>
    {{message.content}}

similar to Java"s jsp

<c:set var="salary" scope="session" value="${2000*2}"/>

now the code
.filteredValue [0]). Sex}


{{(gameDetail = scope.row.gameList.find(item=>item.gameId === scope.column.filteredValue[0]), void 0)}}
{{gameDetail.name}}
{{gameDetail.age}}
{{gameDetail.sex}}

preprocess gamelist with computed


effect:
image.png

Code:

<div v-bind:msg="msg= ''">{{msg}}</div>
<div>{{msg}}</div>
<div v-bind:msg="msg= ''">{{msg}}</div>
<div>{{msg}}</div>

this is also possible:

<div :key="msg= ''">{{msg}}</div>
<div>{{msg}}</div>
<div :key="msg= ''">{{msg}}</div>
<div>{{msg}}</div>

write it to computed


more interesting questions, if not lame, borrow v-for to deal with 1 loop hold variables.


        {{gameDetail.name}}
        {{gameDetail.age}}
        {{gameDetail.sex}}
    </span>
</template>
<template v-else>--</template>
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-1bde138-30c22.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-1bde138-30c22.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?