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

Support v-for="(item, index)" #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Apr 20, 2020

  1. Support v-for="(item, index)"

    This adds rudimentary support for iterating over a value with the
    optional second argument for the index. (Because lists and objects are
    so similar in PHP, this also doubles as support for iterating over an
    object with the optional second argument for the key; the optional third
    argument for the index in that case is not supported, though.)
    
    Note that, due to the limited JS evaluation in this templating engine,
    there’s not a whole lot you can do with the index. In the WikibaseLexeme
    use case, the index is only actually used in a part of the template
    that’s never server-side rendered; the loop still has to be declared
    using the index form even for the PHP renderer, though.
    
    The unrelated change from v-else="" to v-else in the fixtures was
    generated by `npm run-script populate-fixtures`, presumably due to a
    newer Vue.js version now being used – we don’t commit the
    package-lock.json (yet?). I figured I might as well add it, since one of
    the fixtures is changed anyways to test the feature.
    lucaswerkmeister committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    f7e676f View commit details
    Browse the repository at this point in the history