Skip to content

Commit 10a7f5c

Browse files
committed
init
1 parent 400c8d0 commit 10a7f5c

File tree

9 files changed

+4412
-0
lines changed

9 files changed

+4412
-0
lines changed

.gitignore

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

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

app.vue

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div>
3+
<client-only>
4+
<custom-div></custom-div>
5+
</client-only>
6+
</div>
7+
</template>

nuxt.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// https://nuxt.com/docs/api/configuration/nuxt-config
2+
export default defineNuxtConfig({
3+
4+
})

package.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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.3.1"
12+
}
13+
}

plugins/webComponent.client.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default defineNuxtPlugin(() => {
2+
const componentName = 'custom-div'
3+
if (!customElements.get(componentName)) {
4+
class HelloWorldComponent extends HTMLElement {
5+
constructor() {
6+
super();
7+
}
8+
9+
connectedCallback() {
10+
this.innerHTML = `<h1>Hello world! I'm a custom element</h1>`
11+
}
12+
13+
}
14+
15+
customElements.define(componentName, HelloWorldComponent)
16+
}
17+
})

public/favicon.ico

4.19 KB
Binary file not shown.

tsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// https://nuxt.com/docs/guide/concepts/typescript
3+
"extends": "./.nuxt/tsconfig.json"
4+
}

yarn.lock

+4,356
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)