今天开发遇到一个问题,我复用了两个高度相似的组件,在用 v-if 配合开关进行展示的时候,发现组件并未被成功销毁:
解决方法:给两个组件添加不同的 :key=””
出现问题的代码:
<!-- List2 --> <List v-if="whichList===2" :whichList="2"></List> <!-- List1 --> <List v-if="whichList===1" :whichList="1"></List>
解决后:
<!-- List2 --> <List v-if="whichList===2" :whichList="2" :key="2"></List> <!-- List1 --> <List v-if="whichList===1" :whichList="1" :key="1"></List>
EndoPump is a dietary supplement for men’s health. This supplement is said to improve the strength and stamina required by your body to perform various physical tasks. Because the supplement addresses issues associated with aging, it also provides support for a variety of other age-related issues that may affect the body. https://endopumpbuynow.us/