You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inside v-pre, a {{ }} expression shows {{ $citryPrepared.citryText0 }} instead of its value #329
A Citry {{ }} expression inside an element with v-pre shows an
internal name on the page instead of the value or the authored text:
class Live(Component):
template = """
<main>
<div v-pre>{{ 'a' }} and {{ name }}</div>
</main>
"""
def template_data(self, kwargs, slots):
return {"name": "Ann"}
The page shows:
<main><div>{{ $citryPrepared.citryText0 }} and {{ $citryPrepared.citryText1 }}</div></main>
The same happens with or without js, because v-pre alone makes the
component a Vue component.
Why
Citry evaluates each {{ }} in Python and hands the value to Vue as data,
by writing {{ $citryPrepared.<key> }} into the Vue template. Vue skips
everything inside v-pre, so it never reads that data key and prints the
interpolation as text. The writer is in packages/py/citry/citry/_vue/direct_capture.py (the data-key interpolation
around line 3699), which does not check whether the text sits inside v-pre.
What it should do
Inside v-pre, Citry should write the value it already computed as
static text (a and Ann above), because Vue will not substitute it.
Alternatively, it could write the authored {{ ... }} as written, as Vue's
own v-pre does. The first option keeps a Citry {{ }} meaning the same
thing everywhere; the second follows Vue's meaning of v-pre. Either way,
the internal $citryPrepared name must not reach the page.
Found while checking which templates reach the Vue compiler for #313.
Activity