Skip to content

vue.autoInsert.dotValue incorrectly inserts .value in Vue template #6272

Description

@2029397675

Vue - Official extension or vue-tsc version

^3.2.5

VSCode version

1.142.0

Vue version

^3.5.30

TypeScript version

~5.9.3

System Info

After updating VS Code or the Vue (Official) extension, the vue.autoInsert.dotValue setting appears to insert .value in both <script setup> and <template> sections.

Previously, automatic .value insertion worked in the script section only, which was the expected behavior for my workflow.

In Vue 3 templates, top-level refs declared in <script setup> are automatically unwrapped, so adding .value unnecessarily can cause incorrect code and TypeScript errors.

package.json dependencies

Steps to reproduce

Install the Vue (Official) extension.

Set "vue.autoInsert.dotValue": true.

Create a Vue 3 Single File Component using <script setup lang="ts">.

Declare a ref, for example const userArr = ref([]).

Type userArr in the script section and then in the template section.

What is expected?

In <script setup>, typing a ref variable should automatically insert .value.

In , typing the same ref variable should not automatically insert .value.

What is actually happening?

Automatic .value insertion also occurs in the template section.

Link to minimal reproduction

No response

Any additional comments?

OS: Windows

Editor: Visual Studio Code

Extension: Vue (Official) / Vue.volar

VS Code version: [your version]

Extension version: [your extension version]

Vue version: [your project version]

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions