vuejs / vetur

Vue tooling for VS Code.

Home Page:https://vuejs.github.io/vetur/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to comment on a single line inside a vue file

ladyruo opened this issue · comments

VS Code Version:Version: 1.87.2 (user setup)
Commit: microsoft/vscode@863d258
Date: 2024-03-08T15:20:17.278Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0

OS Version: Windows_NT x64 10.0.19045

Steps to Reproduce:

When I first opened vscode, I couldn't comment on a single line in the .vue file, I disabled all the plugins and it still didn't work, and I made sure my shortcuts were correct.
I don't have any problem with single line comments in .html, when I comment a line of code in .html and then go back to .vue, the single line comments in the .vue file work again!

I have a Vue file like this, cmd+/ does nothing if I'm in an html or css region

<template>
    <div>
        <h1>{{ message }}</h1>
        <button @click="changeMessage">Change Message</button>
    </div>
</template>

<script>
export default {
    data() {
        return {
            message: 'Hello, Vue!'
        }
    },
    methods: {
        changeMessage() {
            this.message = 'Message changed!'
        }
    }
}
</script>

<style scoped>
h1 {
    color: #42b983;
}
</style>