Skip to content

Commit

Permalink
feat: hooks done
Browse files Browse the repository at this point in the history
  • Loading branch information
idmytro committed Apr 16, 2023
1 parent c42dc7e commit c6119de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hooks/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Vue 3 + Vite

npx degit idmytro/vue3-multi-starter/minimal myproject
npx degit idmytro/vue3-multi-starter/hooks myproject
7 changes: 4 additions & 3 deletions hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "minimal",
"name": "hooks",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -9,10 +9,11 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.45"
"vue": "^3.2.45",
"vue-hooks-api": "^0.0.0-beta.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"vite": "^4.1.0"
}
}
}
10 changes: 5 additions & 5 deletions hooks/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script setup>
import { ref } from 'vue'
import { useState } from 'vue-hooks-api';
defineProps({
msg: String,
})
msg: String,
});
const count = ref(0)
const [count, setCount] = useState(0);
</script>

<template>
<h1>{{ msg }}</h1>

<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<button type="button" @click="setCount(count++)">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
Expand Down
5 changes: 5 additions & 0 deletions hooks/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ vite@^4.1.0:
optionalDependencies:
fsevents "~2.3.2"

vue-hooks-api@^0.0.0-beta.5:
version "0.0.0-beta.5"
resolved "https://registry.yarnpkg.com/vue-hooks-api/-/vue-hooks-api-0.0.0-beta.5.tgz#e3a220e1d0c33f53edb25fcbe09a5fcaf0ba83e7"
integrity sha512-mMAusw/AHlT1MtNdgrLIoDEd13rEV1EMZuZ8Un929vokDjyBoVu3T/QX26vYXFJ753N5jnnRBe6mHY+hJeJWWA==

vue@^3.2.45:
version "3.2.47"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.47.tgz#3eb736cbc606fc87038dbba6a154707c8a34cff0"
Expand Down

0 comments on commit c6119de

Please sign in to comment.