Browse Source

usefulness of `declare const`

master
pvincent 4 years ago
parent
commit
4276b90774
  1. 2
      src/App.vue
  2. 5
      src/main.ts
  3. 3
      src/shims-vue.d.ts

2
src/App.vue

@ -10,8 +10,6 @@
<script lang="ts"> <script lang="ts">
import HelloWorld from "./components/HelloWorld.vue"; import HelloWorld from "./components/HelloWorld.vue";
console.log(APP_TITLE);
console.log(APP_VERSION);
export default { export default {
name: "App", name: "App",
components: { components: {

5
src/main.ts

@ -2,5 +2,6 @@ import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import './index.css' import './index.css'
document.title = APP_TITLE
createApp(App).mount('#app')
createApp(App).mount('#app')
document.title = APP_TITLE

3
src/shims-vue.d.ts

@ -3,3 +3,6 @@ declare module "*.vue" {
const Component: ReturnType<typeof defineComponent> const Component: ReturnType<typeof defineComponent>
export default Component export default Component
} }
declare const APP_VERSION: string
declare const APP_TITLE: string
Loading…
Cancel
Save