Skip to content

A v-pre element's :value gets a stray v-citry-vue-owned attribute #414

Closed

Description

@JuroOravec

What happens

In a component that uses Vue, an <input :value="..."> written inside v-pre gets a literal v-citry-vue-owned attribute:

<main><div v-pre><input :value='y'></div></main>

The compiled render code, and so the page, carry v-citry-vue-owned="'value'" on the <input>, next to the :value that v-pre keeps as written. <option :selected="..."> gets the same.

Why

vue_owned_native_marker (packages/py/citry/citry/_vue/capture.py) adds the marker for a :value or :selected binding so that Citry knows Vue owns that native property. It does not check whether the element sits inside v-pre, where :value is plain text, not a binding.

Why nothing breaks today

The marker is only an extra attribute. Vue keeps it as written under v-pre, and the server writes the same attribute since #413, so the server HTML and the browser's DOM still match, and hydration has nothing to fix. The page just carries one attribute it should not have.

Expected

Inside v-pre, no v-citry-vue-owned attribute is added.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions