Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue2+cli创建的项目设置"scopedSlotsCompiler": "augmented"后,抖音和小红书小程序循环渲染slot会有异常,只渲染第一个 #5130

Open
antonySee opened this issue Sep 4, 2024 · 0 comments
Labels
mp mini program

Comments

@antonySee
Copy link

antonySee commented Sep 4, 2024

子组件内容:

<template>  
  <view>  
    <view v-for="(item, index) in list" :key="index">  
      <slot :item="item"></slot>  
    </view>  
  </view>  
</template>

父组件:

<template>  
  <view class="content">  
    <Test :list="[1, 2, 4]">  
      <template v-slot:default="{ item }">{{ item }}</template>  
    </Test>  
  </view>  
</template>

mainfest.json:

"mp-toutiao": {  
    "scopedSlotsCompiler": "augmented",  
    "usingComponents": true  
  }

预期结果:
父组件显示传入的数组内容1,2,4,

实际结果:
只渲染了传入数组的第一个值:1,1,1

"scopedSlotsCompiler"默认为auto的时候会报错“主包不能引用分包文件”,看了论坛之后改成了"scopedSlotsCompiler": "augmented",这样的话编译确实通过了,但是实际打包头条和小红书小程序后,插槽传值始终都是1个;

环境是:vue2+cli(官网最新版本和alpha版本都试过都有此问题)

@bfc846958672 bfc846958672 added the mp mini program label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mp mini program
Projects
None yet
Development

No branches or pull requests

2 participants