Skip to content

Commit 14bc5b5

Browse files
committed
feat: init
0 parents  commit 14bc5b5

11 files changed

+6583
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
*.log*
3+
.nuxt
4+
.nitro
5+
.cache
6+
.output
7+
.env
8+
dist

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist = true

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Nuxt Macros Demo
2+
3+
[Nuxt 3](https://v3.nuxtjs.org/) + [Vue Macros](https://vue-macros.sxzz.moe/)

app.vue

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script setup lang="ts">
2+
import DefineOptions from './examples/define-options/index.vue'
3+
</script>
4+
5+
<template>
6+
<div>
7+
<h1>Nuxt App</h1>
8+
<DefineOptions />
9+
</div>
10+
</template>

envs.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="unplugin-vue-macros/macros-global" />

examples/define-options/index.vue

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup lang="ts">
2+
defineOptions({
3+
name: 'DefineOptionsApp',
4+
})
5+
6+
const vm = getCurrentInstance()!
7+
const compName = vm.type.name
8+
</script>
9+
10+
<template>
11+
<p>
12+
defineOptions: <b>{{ compName }}</b>
13+
</p>
14+
</template>

nuxt.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import VueMacros from 'unplugin-vue-macros/vite'
2+
3+
export default defineNuxtConfig({
4+
typescript: {
5+
shim: false,
6+
},
7+
vite: {
8+
plugins: [VueMacros()],
9+
},
10+
})

package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"build": "nuxt build",
5+
"dev": "nuxt dev",
6+
"generate": "nuxt generate",
7+
"preview": "nuxt preview",
8+
"postinstall": "nuxt prepare"
9+
},
10+
"devDependencies": {
11+
"nuxt": "3.0.0-rc.12",
12+
"unplugin-vue-macros": "^0.15.0"
13+
}
14+
}

0 commit comments

Comments
 (0)