Giter VIP home page Giter VIP logo

Comments (5)

Skiyee avatar Skiyee commented on June 8, 2024 2

那有什么代替方案?我认为这种包裹 v-if 的写法是很常见的 @18148764734

from uni-app.

Skiyee avatar Skiyee commented on June 8, 2024

复现:Vue-Playground

from uni-app.

Skiyee avatar Skiyee commented on June 8, 2024

export const transformSlot: NodeTransform = (node, context) => {

这段代码执行返回一个数组,但该数组是通过 findDir 扫描是否含有 slot 来判断的,但却忽略是否含有 v-if,导致产物 Prop 中的 u-s 传递是父文件内所有已使用 slot.

from uni-app.

Skiyee avatar Skiyee commented on June 8, 2024

目前产物:
image

理想产物:
image

from uni-app.

18148764734 avatar 18148764734 commented on June 8, 2024

感谢反馈,目前对于这个v-if,v-slot的处理涉及到各种复杂情况,只能暂时先采用静态编译slot插槽的方案,无法在运行时动态的根据变量判断。

from uni-app.

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.