The computational attributes in vue are determined by the data that is requested to be returned.

<template>
    <div
       v-if="type == xxx"        
        ></div>
       //type
</template>


computed:{
    type(){
        return (ajax)
    }
}
Oct.23,2021

computed is calculated on the basis of existing data and cannot be calculated in this way


you can first define a variable in data, then give a default value, and the ajax method requests to come back and write back the variable you set before; then calculate the attribute type and then according to the variable you defined.

<template>

<div
   v-if="type == xxx"        
    ></div>
   //type
</template>
data(){
    return {
        type1: '',(ajax)
    }
},
computed:{

type(){
    return this.type1
}
}
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-1eb30fb-2424.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-1eb30fb-2424.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?