优化选择地区自动绑定model以及地址自动识别示例编写

This commit is contained in:
2022-03-30 15:36:45 +08:00
parent 5d2692f2c6
commit c72a8e051b
-56
View File
@@ -1,56 +0,0 @@
<template>
<div>
<div class="box-later-2">{{'父组件在子组件使用v-model,子组件使用value接收父组件的传参'}}</div>
<div class="box-later-2">{{value}}</div>
</div>
</template>
<script>
export default {
props: {
// 🚀 子组件使用value接收父组件的传参
value: {
type: Object,
}
// value:
// {
// type: Object,
// // default: () => {
// // return {
// // province_code: "",
// // province: "",
// // city_code: "",
// // city: "",
// // area_code: "",
// // area: "",
// // };
// // },
// },
},
created() {
this.$emit("input",{ 11:'22'});
}
// model: {
// // 使用model, 这儿2个属性,prop属性说,我要将msg作为该组件被使用时(此处为aa组件被父组件调用)v-model能取到的值,event说,我emit ‘cc’ 的时候,参数的值就是父组件v-model收到的值。
// prop:
// "defaultAddress",
// // {
// // defaultAddress: {
// // type: Object,
// // default: () => {
// // return {
// // province_code: "",
// // province: "",
// // city_code: "",
// // city: "",
// // area_code: "",
// // area: "",
// // };
// // },
// // },
// // },
// event: "currentAddress",
// },
}
</script>