Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Renaming of template refs is not reflected in the template #135

Closed
@ushironoko

Description

@ushironoko

Overview

This plugin seems to intentionally correct variable names in the ref object if they are covered by key names of other objects.

example:

<scriptsetup>const listeners = computed(() =>({input:handleInput,}))constinput=ref(null);// renamed to input2</script>

However, the variable name modification is not done on the template side, so the ties are broken.

<scriptsetup>const listeners = computed(() =>({input:handleInput,}))constinput=ref(null);// renamed to input2</script><template>  <!-- not renamed --><inputref="input"v-on="listeners""></template>

This does not seem to happen in Vue3 (variable names are not modified).

Expected behavior

As with Vue3, no intentional variable name modification is performed. However, I am not aware of how this feature was implemented so I am missing that consideration. Thanks.

Sample

Reproducible code can be found below.

https://github.com/ushironoko/unplugin-vue2-script-setup-not-renamed-template-ref

deps:

  "dependencies": {    "vue": "^2.6.12"  },  "devDependencies": {    "@vue/composition-api": "1.4.6",    "@vue/runtime-dom": "^3.2.33",    "typescript": "^4.5.4",    "unplugin-vue2-script-setup": "0.10.2",    "vite": "^2.9.2",    "vite-plugin-vue2": "1.9.3",    "vue-template-compiler": "2.6.14"  }

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp