Skip to content

Open source personal finance application

feat (script setup): init

ilkomed69417ca9bf6
diff --git a/nuxt.config.js b/nuxt.config.js
index 5d7145e8..e13d322e 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -92,8 +92,13 @@ export default defineNuxtConfig({
'@nuxtjs/pwa',
// https://tailwindcss.nuxtjs.org/
'@nuxtjs/tailwindcss',
+ 'unplugin-vue2-script-setup/nuxt',
],
+ scriptSetup: {
+ reactivityTransform: true,
+ },
+
alias: {
tslib: 'tslib/tslib.es6.js',
},
diff --git a/package-lock.json b/package-lock.json
index 09978ab8..d2d9ce23 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18584,7 +18584,8 @@
"node_modules/os-browserify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
- "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc="
+ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=",
+ "license": "MIT"
},
"node_modules/os-homedir": {
"version": "1.0.2",
diff --git a/pages/dev/ref-sugar.vue b/pages/dev/ref-sugar.vue
new file mode 100644
index 00000000..d8273c18
--- /dev/null
+++ b/pages/dev/ref-sugar.vue
@@ -0,0 +1,17 @@
+<script setup lang="ts">
+console.log(111)
+const h = ref('ref 1')
+
+const h2 = $ref('ref 2')
+
+console.log('h', h.value)
+console.log('h2', h2)
+
+const hey = (param: string): void => {
+ console.log('sss', param)
+}
+</script>
+
+<template lang="pug">
+h1(@click="hey('ii')") hello {{ h }}
+</template>
diff --git a/tsconfig.json b/tsconfig.json
index 693cc66b..20366410 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,5 +5,11 @@
],
"vueCompilerOptions": {
"experimentalCompatMode": 2
+ },
+ "compilerOptions": {
+ "types": [
+ "unplugin-vue2-script-setup/types",
+ "unplugin-vue2-script-setup/ref-macros"
+ ]
}
}