$ sudo npm install -g @vue/cli
$ npm install –save vue-class-component
$ npx vue create vue3_type_app
Manually select features
◯ TypeScript (スペースキーでセットする)
❯ 3.x
❯ ESLint with error prevention only
❯◉ Lint on save
❯ In dedicated config files
App.vue
<template> <HelloWorld /> </template>
HelloWorld.vue
<script lang="tsx"> import { VNode } from 'vue' import { Vue } from 'vue-class-component' export default class HelloWorld extends Vue { msg = "Vue sample." val = 1 doAction():void { this.val += 1 } render():VNode { return(<div> <h1 class="bg-info text-white p-2">{this.msg}</h1> <div class="container"> <h2 class="my-3">number counter.</h2> <div class="alert alert-info"> <h3 onClick={this.doAction}>{this.val} count.</h3> </div> </div> </div>) } } </script>
node_modules/vue-class-component/lib”‘ has no exported member ‘Vue’.
うーん、上手くいかんな…