Browse Source

formatted

master
pvincent 4 years ago
parent
commit
7973b5431d
  1. 4
      .prettierrc.yml
  2. 9
      src/App.vue
  3. 21
      src/components/HelloWorld.vue
  4. 36
      src/components/HelloWorldSfc.vue

4
.prettierrc.yml

@ -1,4 +1,4 @@
trailingComma: "none"
tabWidth: 4
trailingComma: 'none'
tabWidth: 2
semi: false semi: false
singleQuote: true singleQuote: true

9
src/App.vue

@ -1,25 +1,22 @@
<template> <template>
<img alt="Vue logo" src="./assets/logo.png" width="150" /> <img alt="Vue logo" src="./assets/logo.png" width="150" />
<HelloWorld :msg="title" /> <HelloWorld :msg="title" />
<HelloWorldSfc :msg="title" />
<br />
<footer style="margin-top: 2em">
AGPLv3 : AGPLv3 :
<a :href="origin" alt="origin"> <a :href="origin" alt="origin">
{{ version }} {{ version }}
</a> </a>
</footer>
</template> </template>
<script lang="ts"> <script lang="ts">
/* standard composition api */
/* eslint-disable no-undef */ /* eslint-disable no-undef */
import HelloWorld from './components/HelloWorld.vue' import HelloWorld from './components/HelloWorld.vue'
import HelloWorldSfc from './components/HelloWorldSfc.vue'
export default { export default {
name: 'App', name: 'App',
components: { components: {
HelloWorld,
HelloWorldSfc
HelloWorld
}, },
setup() { setup() {
return { return {

21
src/components/HelloWorld.vue

@ -7,26 +7,25 @@
<script lang="ts"> <script lang="ts">
/* standard composition api */ /* standard composition api */
import { ref } from "vue";
import { ref } from 'vue'
export default { export default {
props: { props: {
msg: { msg: {
type: String, type: String,
required: true,
},
required: true
}
}, },
setup() { setup() {
return { return {
count: ref(1),
};
count: ref(1)
}
}, },
methods: { methods: {
inc() { inc() {
console.log("increment count");
this.count++;
},
},
};
console.log('increment count')
this.count++
}
}
}
</script> </script>

36
src/components/HelloWorldSfc.vue

@ -1,36 +0,0 @@
<template>
<h1>{{ msg }}</h1>
<button @click="count++">
count is: {{ count }}
</button>
<button @click="inc">
inc
</button>
<p>Hello World!</p>
</template>
<script lang="ts">
/* standard composition api */
import { ref } from 'vue'
export default {
props: {
msg: {
type: String,
required: true
}
},
setup() {
return {
count: ref(1)
}
},
methods: {
inc() {
console.log("increment count");
this.count++;
},
},
};
</script>
Loading…
Cancel
Save