Vue father and son pass values, how to use computed to receive and manipulate data?

how do you use computed to receive and manipulate data when values are passed by father and son?

parent component

// 
<Current
      :status="orderID"
/>
data() {
    return {
      orderID: "",
    };
},
methods: {
  // , 
  getOrderID(orderID) {
    this.orderID = orderID;
  },
},

subcomponents

props: {
    status: {
      type: String,
      default: String,
    },
},
// computed

the child component has passed a value from the parent component successfully
clipboard.png

Apr.08,2022

<template>
  <div>{{statusText}}</div>
</template>

<script>
export default {
  props: {
    status: {
      type: String,
      default: String
    }
  },
  components: {},
  data () {
    return {}
  },
  computed: {
    statusText () {
      console.log(this.status)
      if (this.status === '1234') {
        return ''
      }
    }
  },
  created () {
  },
  methods: {}
}
</script>


computed: {dataGet () {return this.status}}
because you want to use getter, use
the method I have used in template is < div v br model = "dataGet" style= "display:none" > < / div >


sub-component can already obtain statusText data. It is recommended to use vuex to deal with the relevant data in getters.

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