vue finishing daily.

1. Sons pass component value problem:

As Aipreview.vue file (parent component)parent - child >>

<template>
<div>
<MyHeader: SomeData = "some_data"> </ myHeader> / * parent components directly transmitted through the attribute * /
</div>
</template >

<script>
import MyHeader from "@/components/MyHeader";
export default {

components: {
MyHeader
},

data: function() {
return {

some_data: {
name: "ss",
age: 12
}
};
},

mounted:function(){
// If there is an asynchronous operation zone update this.some_data; so somedata items, be sure to write it all, otherwise the object will not be updated
}
};
</script>
                                                                                                          

Guess you like

Origin www.cnblogs.com/liuliu-hai/p/11585339.html