Skip to content

Commit b78ffe1

Browse files
add tiptap
1 parent 03bd8ea commit b78ffe1

File tree

4 files changed

+539
-36
lines changed

4 files changed

+539
-36
lines changed

app/nuxt.config.ts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,7 @@ export default defineNuxtConfig({
2828
global: true,
2929
dirs: [{ path: '~/components', prefix: 'tk' }],
3030
},
31-
modules: [
32-
'@nuxt-alt/auth',
33-
'@nuxt-alt/http',
34-
'@pinia/nuxt',
35-
'nuxt-quasar-ui',
36-
'@vueuse/nuxt',
37-
'dayjs-nuxt',
38-
...appSetup(),
39-
],
31+
modules: ['@nuxt-alt/auth', '@nuxt-alt/http', '@pinia/nuxt', 'nuxt-quasar-ui', '@vueuse/nuxt', 'dayjs-nuxt', ...appSetup()],
4032
auth: {
4133
globalMiddleware: true,
4234
rewriteRedirects: true,
@@ -78,18 +70,24 @@ export default defineNuxtConfig({
7870
locales: ['fr', 'en'],
7971
defaultLocale: 'fr',
8072
defaultTimezone: 'Paris',
81-
plugins: ['timezone', 'relativeTime']
73+
plugins: ['timezone', 'relativeTime'],
8274
},
83-
pinia:{
84-
autoImports: [
85-
'defineStore'
86-
]
75+
pinia: {
76+
autoImports: ['defineStore'],
8777
},
8878
appConfig: {
8979
customSlots: {},
9080
},
9181
quasar: {
9282
iconSet: 'mdi-v5',
83+
plugins: ['Notify'],
84+
config: {
85+
notify: {
86+
timeout: 2500,
87+
position: 'top-right',
88+
actions: [{ icon: 'mdi-close', color: 'white' }],
89+
},
90+
},
9391
},
9492
vite: {
9593
define: {
@@ -98,6 +96,7 @@ export default defineNuxtConfig({
9896
plugins: [
9997
pugPlugin(<any>{
10098
pretty: true,
99+
compilerOptions: {},
101100
}),
102101
],
103102
},
@@ -112,7 +111,7 @@ export default defineNuxtConfig({
112111
shim: false,
113112
},
114113
hooks: {
115-
'ready': async () => {
114+
ready: async () => {
116115
console.log('[OpenapiTS] Generating .nuxt/types/service-api.d.ts...')
117116
try {
118117
const fileData = await openapiTS(`${TK_APP_API_URL}/swagger/json`)
@@ -121,6 +120,6 @@ export default defineNuxtConfig({
121120
} catch (error) {
122121
console.debug('[OpenapiTS] Error while generating .nuxt/types/service-api.d.ts', error)
123122
}
124-
}
125-
}
123+
},
124+
},
126125
})

app/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"@nuxt-alt/http": "^1.6.8",
1717
"@pinia/nuxt": "^0.4.11",
1818
"@quasar/extras": "^1.16.6",
19+
"@tiptap/pm": "^2.1.11",
20+
"@tiptap/starter-kit": "^2.1.11",
21+
"@tiptap/vue-3": "^2.1.11",
1922
"@vueuse/router": "^10.4.1",
2023
"bson-objectid": "^2.0.4",
2124
"cookie": "^0.5.0",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<editor-content :editor="editor" />
3+
</template>
4+
5+
<script setup>
6+
import { useEditor, EditorContent } from '@tiptap/vue-3'
7+
import StarterKit from '@tiptap/starter-kit'
8+
9+
const editor = useEditor({
10+
content: '<p>I’m running Tiptap with Vue.js. 🎉</p>',
11+
extensions: [
12+
StarterKit,
13+
],
14+
})
15+
</script>

0 commit comments

Comments
 (0)