R
R
Ruslan2019-10-28 10:04:10
visual studio
Ruslan, 2019-10-28 10:04:10

How to get Intellisense for vue in template block in VisualStudio?

Hello.
The problem is that when I type the names of typed variables in the template code, visual studio does not list the fields of these types.
For example, here is the component code:

<template>
    <div>
        <div>{{ foo.a }}</div>

        <div v-for="x in bar">{{ x.a }} *** {{ x.b }}</div>

    </div>
</template>

<script lang="ts">
    import { Component, Vue } from 'vue-property-decorator'

    @Component
    export default class TestComponent extends Vue {
        foo: myclass = { a: "bar", b: 12 };
        bar: Array<myclass> = [{ a: "aaa", b: 1 }, { a: "bbb", b: 2 }, { a: "ccc", b: 3 }]
    }


    class myclass {
        a!: string;
        b!: number;
    }
</script>

if you start writing the name of the variable "foo." in curly brackets, then no hints appear.
As I understand it, she (or it?) (vs) just doesn't know how to do it.
I found the Vue.js Pack 2019 extension, but it doesn't do what I need.
Maybe someone knows an extension with which intellisense will work in such situations, and if there is no such extension, then you can probably write it yourself ...
in general, in order not to start reinventing the wheel, someone may have already found solutions such Problems?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question