microsoft / TypeScript-Vue-Starter

A starter template for TypeScript and Vue with a detailed README describing how to use the two together.
MIT License
4.45k stars 592 forks source link

Update documentation to Vue-loader 15. #47

Closed runxc1 closed 5 years ago

runxc1 commented 6 years ago

If you follow this tutorial today you will run into errors as the vue loader was updated to version 15 a month ago and requires a couple additional configuration settings not found in the current documentation

Bouke commented 6 years ago

Thank you, I needed this to follow the instructions.

jgardner04 commented 6 years ago

I had to use this to get the tutorial working with vue-loader v15. What do we need to do to get his merged in?

tonystonee commented 6 years ago

Is anyone having problems with Mixins? If I include a mixin and try to use one of its properties, I get:

Property 'initialEnthusiasm' does not exist on type 'CombinedVueInstance<Vue, {}, {}, {}, Readonly<Record<never, any>>>'.

src/mixins/chicken.ts

export default {
    props: ['name', 'initialEnthusiasm'],
};

src/components/Hello.vue

<template>
    <div>
        <div class="greeting">Hello {{name}}{{exclamationMarks}}</div>
        <button @click="decrement">-</button>
        <button @click="increment">+</button>
    </div>
</template>

<script lang="ts">
import Vue from "vue";
import Chicken from '../mixins/chicken';

export default Vue.extend({
    mixins:[Chicken],
    data() {
        return {
            enthusiasm: this.initialEnthusiasm,
        }
    },
    methods: {
        increment() { this.enthusiasm++; },
        decrement() {
            if (this.enthusiasm > 1) {
                this.enthusiasm--;
            }
        },
    },
    computed: {
        exclamationMarks(): string {
            return Array(this.enthusiasm + 1).join('!');
        }
    }
});
</script>

<style>
.greeting {
    font-size: 20px;
}
</style>
tynx commented 6 years ago

May I kindly ask: Why is this PR not merged? I just spent quite some time to figure out why had errors with the loaders only to find out that the this guide is outdated. To then find a perfectly fine solution (AFAIT) in a PR which is not merged does not make sense to me...

@DanielRosenwasser As top dev - can you merge it?

ehajri commented 5 years ago

please merge?

danbudris commented 5 years ago

Ya'll should consider merging this. I ran into this while using the getting started guide, and had to spend some time finding this issue before I could move forward. Seems like others are experiencing this too.

planetchili commented 5 years ago

Why is this not merged yet?

runxc1 commented 5 years ago

With the new vue cli 3 and the vue ui which can be used to start a new project very easily. The whole tutorial seems very out of date.

shguanbin commented 5 years ago

thanks~i get it~

orta commented 5 years ago

Alright, lets get this in now 👍