pvincent
4 years ago
6 changed files with 85 additions and 60 deletions
-
5.eslintrc.yml
-
10.vscode/settings.json
-
34doc/INDEX.md
-
23src/App.vue
-
37src/components/Basket.vue
-
36src/components/HelloWorld.vue
@ -1,19 +1,29 @@ |
|||
DOCUMENTATION |
|||
============= |
|||
|
|||
First Initialization |
|||
--------------------- |
|||
|
|||
## First Initialization |
|||
```bash |
|||
npm init vite-app protovue |
|||
cd protovue |
|||
npm install |
|||
npm install typescript |
|||
> ... |
|||
> tsconfig.json, shims-vue.d.ts, main.ts, index.html |
|||
see [vue3+typescript+vite](https://stackoverflow.com/questions/63724523/how-to-add-typescript-to-vue-3-and-vite-project#64438876) |
|||
npm run dev |
|||
``` |
|||
Logo |
|||
----- |
|||
|
|||
* npm init vite-app vapara-vue3 |
|||
* cd vapara-vue3 |
|||
* npm install |
|||
* npm install typescript |
|||
* ...tsconfig.json, shims-vue.d.ts, main.ts, index.html |
|||
* see [vue3+typescript+vite](https://stackoverflow.com/questions/63724523/how-to-add-typescript-to-vue-3-and-vite-project#64438876) |
|||
* npm run dev |
|||
inspired by [Astrologia: Yantra de Śrī Kamalātmikā Devī](https://sriganesa.blogspot.com/2014/03/yantra-de-sri-kamalatmika-devi.html) |
|||
|
|||
## Logo |
|||
Hints |
|||
----- |
|||
|
|||
### Vue3/Typescript |
|||
|
|||
* use defineComponent for Component |
|||
* console.log not accepted except warn and error |
|||
|
|||
inspired by |
|||
Astrologia: Yantra de Śrī Kamalātmikā Devī |
|||
https://sriganesa.blogspot.com/2014/03/yantra-de-sri-kamalatmika-devi.html |
@ -0,0 +1,37 @@ |
|||
<template> |
|||
<h1>{{ msg }}</h1> |
|||
<button |
|||
class="border border-purple-200 rounded-full font-semibold py-1 px-4 text-sm text-purple-600 hover:bg-purple-600 hover:border-transparent hover:text-white focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2" |
|||
@click="count++" |
|||
> |
|||
inc product {{ count }} |
|||
</button> |
|||
<button |
|||
class="border border-purple-200 rounded-full font-semibold py-1 px-4 text-sm text-purple-600 hover:bg-purple-600 hover:border-transparent hover:text-white focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2" |
|||
@click="inc" |
|||
> |
|||
inc |
|||
</button> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, ref } from 'vue' |
|||
export default defineComponent({ |
|||
props: { |
|||
msg: { type: String, required: true } |
|||
}, |
|||
setup() { |
|||
return { |
|||
count: ref(0) |
|||
} |
|||
}, |
|||
methods: { |
|||
inc() { |
|||
// console.log('log count') |
|||
console.warn('warn count') |
|||
console.error('err count') |
|||
this.count++ |
|||
} |
|||
} |
|||
}) |
|||
</script> |
@ -1,36 +0,0 @@ |
|||
<template> |
|||
<h1>{{ msg }}</h1> |
|||
<button |
|||
class="px-4 py-1 text-sm text-purple-600 font-semibold rounded-full border border-purple-200 hover:text-white hover:bg-purple-600 hover:border-transparent focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2" |
|||
@click="count++" |
|||
> |
|||
inc product {{ count }} |
|||
</button> |
|||
<button |
|||
class="px-4 py-1 text-sm text-purple-600 font-semibold rounded-full border border-purple-200 hover:text-white hover:bg-purple-600 hover:border-transparent focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2" |
|||
@click="inc" |
|||
> |
|||
inc |
|||
</button> |
|||
</template> |
|||
|
|||
<script lang="ts"> |
|||
import { defineComponent, ref } from 'vue' |
|||
export default defineComponent({ |
|||
props: { |
|||
msg: { type: String, required: true }, |
|||
n: { type: Number, required: true } |
|||
}, |
|||
setup() { |
|||
return { |
|||
count: ref(0) |
|||
} |
|||
}, |
|||
methods: { |
|||
inc() { |
|||
console.log('increment count') |
|||
this.count++ |
|||
} |
|||
} |
|||
}) |
|||
</script> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue