Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
@nuxtjs/composition-api
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaddeusJiang committed Mar 13, 2021
1 parent 26ee9fc commit 0c174ab
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,6 @@
{
"cSpell.words": [
"entrypoint",
"windicss"
]
}
18 changes: 18 additions & 0 deletions components/Counter.vue
@@ -0,0 +1,18 @@
<template>
<div>
{{ count }}
<button @click="count += 1">+</button>
</div>
</template>

<script lang="ts">
import { defineComponent, ref } from '@nuxtjs/composition-api'
export default defineComponent({
setup() {
const count = ref(0)
return { count }
},
})
</script>
1 change: 1 addition & 0 deletions jest.config.js
Expand Up @@ -3,6 +3,7 @@ module.exports = {
'^@/(.*)$': '<rootDir>/$1',
'^~/(.*)$': '<rootDir>/$1',
'^vue$': 'vue/dist/vue.common.js',
'@nuxtjs/composition-api': '@nuxtjs/composition-api/lib/entrypoint.js',
},
moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
transform: {
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.js
Expand Up @@ -30,6 +30,7 @@ export default {
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module',
'nuxt-windicss',
'@nuxtjs/composition-api',
],

// Modules: https://go.nuxtjs.dev/config-modules
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -25,6 +25,7 @@
"dependencies": {
"@nuxt/content": "^1.11.1",
"@nuxtjs/axios": "^5.12.5",
"@nuxtjs/composition-api": "^0.22.1",
"@nuxtjs/pwa": "^3.3.5",
"core-js": "^3.8.3",
"nuxt": "^2.14.12"
Expand Down
26 changes: 6 additions & 20 deletions pages/index.vue
@@ -1,34 +1,20 @@
<template>
<div class="container">
<div>
<Logo />
<h1 class="title">stoic-web</h1>
<div class="links">
<a
href="https://nuxtjs.org/"
target="_blank"
rel="noopener noreferrer"
class="button--green"
>
Documentation
</a>
<a
href="https://github.com/nuxt/nuxt.js"
target="_blank"
rel="noopener noreferrer"
class="button--grey"
>
GitHub
</a>
</div>

<counter />
</div>
</div>
</template>

<script lang="ts">
import Vue from 'vue'
import Counter from '~/components/Counter.vue'
export default Vue.extend({})
export default Vue.extend({
components: { Counter },
})
</script>

<style>
Expand Down
23 changes: 21 additions & 2 deletions yarn.lock
Expand Up @@ -1724,6 +1724,18 @@
consola "^2.15.3"
defu "^3.2.2"

"@nuxtjs/composition-api@^0.22.1":
version "0.22.1"
resolved "https://registry.yarnpkg.com/@nuxtjs/composition-api/-/composition-api-0.22.1.tgz#aa14065b489bbdd3ce72f32132d8a7ffd96ac1a6"
integrity sha512-47yAd9GCj2K7OLmM/U03LkldNyXU0zGEjgUrIodD/2vMZArGjFsPoRns6K4oIvvUKeia8MXzjEMYxAsSm5IFlw==
dependencies:
"@vue/composition-api" "1.0.0-rc.5"
defu "^3.2.2"
estree-walker "^2.0.2"
magic-string "^0.25.7"
ufo "^0.6.10"
upath "^2.0.1"

"@nuxtjs/eslint-config-typescript@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/eslint-config-typescript/-/eslint-config-typescript-5.0.0.tgz#060c1402e559b1df78c8c19b2f5a873eac53cab2"
Expand Down Expand Up @@ -2456,6 +2468,13 @@
optionalDependencies:
prettier "^1.18.2"

"@vue/composition-api@1.0.0-rc.5":
version "1.0.0-rc.5"
resolved "https://registry.yarnpkg.com/@vue/composition-api/-/composition-api-1.0.0-rc.5.tgz#9b857743dd2692073b6df90fa2cfb9a75a1bb2f6"
integrity sha512-sFBUDZxwi5YOQqH//VSGenO6WH0JuW94+CWo1eUsGSTRue8POfwD4oeduVqi/c6QcwXg2tJL/m6aOD2t/IR6zg==
dependencies:
tslib "^2.1.0"

"@vue/shared@3.0.7":
version "3.0.7"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.7.tgz#96d52988efc07444c108c7c6803ba7cc93e40045"
Expand Down Expand Up @@ -5715,7 +5734,7 @@ estraverse@^5.1.0, estraverse@^5.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==

estree-walker@^2.0.1:
estree-walker@^2.0.1, estree-walker@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
Expand Down Expand Up @@ -12814,7 +12833,7 @@ tslib@^1.8.1, tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.0.3:
tslib@^2.0.3, tslib@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==
Expand Down

0 comments on commit 0c174ab

Please sign in to comment.