GithubHelp home page GithubHelp logo

Comments (7)

jw-star avatar jw-star commented on May 21, 2024

4.8.5 同样问题,切换到tab,只会渲染一次,再次点击,子组件不渲染

  <van-tabs type="card">
    <van-tab title="全部">
      <ViewTaskList taskStatus=""  ></ViewTaskList>
    </van-tab>
    <van-tab title="已完成">
      <ViewTaskList taskStatus="1"  ></ViewTaskList>
    </van-tab>
    <van-tab title="处理中">
      <ViewTaskList taskStatus="0"  ></ViewTaskList>
    </van-tab>
    <van-tab title="已退还">
      <ViewTaskList taskStatus="2"  ></ViewTaskList>
    </van-tab>

    <van-tab title="反馈历史">
      <ViewTaskList taskStatus="3"  ></ViewTaskList>
    </van-tab>

  </van-tabs>

from vant.

inottn avatar inottn commented on May 21, 2024

重现链接打不开

from vant.

jw-star avatar jw-star commented on May 21, 2024

随机给key也不行,会渲染多次tab

  <van-tabs type="card" @click-tab="onClickTab">
    <van-tab :title="tab.title"  :key="tab.title" v-for="tab in tabs">
      <ViewTaskList :taskStatus="tab.status"></ViewTaskList>
    </van-tab>
  </van-tabs>

from vant.

jw-star avatar jw-star commented on May 21, 2024

解决 @Cyan-963852 @inottn

  <van-tabs type="card" @click-tab="onClickTab">
    <van-tab :title="tab.title"   v-for="tab in tabs">
      <ViewTaskList :taskStatus="tab.status" :key="new Date().getTime()"></ViewTaskList>
    </van-tab>
  </van-tabs>

from vant.

Cyan-963852 avatar Cyan-963852 commented on May 21, 2024

解决 @Cyan-963852 @inottn

  <van-tabs type="card" @click-tab="onClickTab">
    <van-tab :title="tab.title"   v-for="tab in tabs">
      <ViewTaskList :taskStatus="tab.status" :key="new Date().getTime()"></ViewTaskList>
    </van-tab>
  </van-tabs>

这不会增加额外的开销吗,成本太大了吧
而且你这个不对,我不是tab的Content没有响应式,我是title

from vant.

Cyan-963852 avatar Cyan-963852 commented on May 21, 2024

重现链接打不开

链接已更新

from vant.

inottn avatar inottn commented on May 21, 2024

不使用 slot 渲染 title 时,title prop 接受的是 string 类型。你可以把第二个 tabs 移除,或者确保传入的 title 是 string 而不是 number。

from vant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.