official-account放在组件中只有第一次展示

发布于 6 年前作者 xiuyingshi5782 次浏览最后编辑 6 年前来自 ask

official-account做成了一个自定义的组件public-account

<view>

    <official-account></official-account>

</view>

在某个template1中引入了该组件,

<template name=“A”>

    <public-account></public-account>

</template>

index中引入A,

<template is=‘A’></template>

多个template用wx-if切换

<template wx=if=‘{{active==1}}’ is=‘A’></template>

<template wx=if=‘{{active==2}}’ is=‘B’></template>

<template wx=if=‘{{active==3}}’ is=‘C’></template>

这种情况下只有第一次切换到A时才展示official-account

2 回复
liufang
liufang1 楼6 年前

麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

nzhou
nzhou2 楼4 年前

用hidden进行切换