关于小程序分享后,页面内组件props数据变为null的问题
主页部分代码
<template>
<view class="stroe_home">
<loginDialog />
<float-like-button :storeId="option.shop_id" :num="option.like" />
<store-info-bar :option="option" />
<main-swiper :swiperHeight="swiperHeight" :imgs="swiperImages" />
<view class="stroe_home__content">
<store-commodity :storeId="option.shop_id" />
</view>
</view>
</template>
<script>
data() {
return {
option: {},
}
},
onLoad(option) {
// 解析传参并赋值
this.option = decodeUrl(option)
},
</script>
组件代码
<template>
<view class="mod_store_info_bar">
<view class="mod_store_info_bar__name_and_action">
<view class="mod_store_info_bar__name_and_action__name auto_omitted">{{option.shop_name}}</view>
<view class="mod_store_info_bar__name_and_action__action">
<store-share-button style="margin-right: 10upx;" />
<subscription-button :storeId="option.shop_id" />
</view>
</view>
<view class="mod_store_info_bar__info">
<view class="mod_store_info_bar__info__address ">
<view class="auto_omitted" @tap="toMap">{{option.addr}}</view>
<text class="iconfont"></text>
</view>
<text>{{option.visits}}人来过</text>
</view>
</view>
</template>
<script>
props: {
option: {
type: Object,
required: true
}
},
</script>
分享后console.log
在主页传递数据只改变了1次,但组件内props却改变了2次
请大佬解惑