Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
earlAchromatic committed Nov 22, 2023
2 parents 20d5cae + e1bf25c commit ef45d2d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 27 deletions.
18 changes: 0 additions & 18 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const componentRegistry = {

module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({ public: '/' });
eleventyConfig.addPassthroughCopy('components');
eleventyConfig.addPassthroughCopy('node_modules');

eleventyConfig.on(
Expand All @@ -30,23 +29,6 @@ module.exports = function (eleventyConfig) {
}
);

eleventyConfig.addPlugin(EleventyVitePlugin, {
tempFolderName: '.11ty-vite', // Default name of the temp folder

// Defaults are shown:
viteOptions: viteConfig,
});
};

function transformContent(content) {
let dom = new JSDOM(content);
let doc = dom.window.document;

tryComponents(doc);

return dom.serialize();
}

function tryComponents(doc) {
for (const [key, value] of Object.entries(componentRegistry)) {
let registeredComponent = key;
Expand Down
7 changes: 7 additions & 0 deletions components/MyLeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<nav>
<a href="/index">
<slot > </slot>
</a>
</nav>
</template>
4 changes: 2 additions & 2 deletions components/SlottedComp.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<template>
<h2>Slot here</h2>
<slot>steady</slot>
<h2>Slot</h2>
<slot></slot>
</template>
2 changes: 1 addition & 1 deletion components/myFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<slot name="title"> </slot>
</a>
<b>
<slot name="option"> </slot>
<slot name="option"> sadf </slot>
</b>
</footer>
</template>
2 changes: 1 addition & 1 deletion components/myHeader.vue → components/myReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AsyncComp = defineAsyncComponent({
return new Promise((resolve) => {
setTimeout(() => {
resolve(import('./SlottedComp.vue'));
}, 2000);
}, 4000);
});
},
loadingComponent: Loading,
Expand Down
6 changes: 3 additions & 3 deletions page.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<myFooter>
<template v-slot:title>
<div>
<p>Some text here</p>
<h2>Some title here</h2>
<p>Some here</p>
<h2>Some here</h2>
</div>
</template>

<template v-slot:option>this is your option</template>
<template v-slot:option>this</template>
</myFooter>
2 changes: 0 additions & 2 deletions vueTx.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ eleventyConfig.addTransform(

function tryComponents() {
for (const [key, value] of Object.entries(componentRegistry)) {
let registeredComponent = key;
let registeredComponentPath = value;
console.log(key);
let comp = doc.querySelector(registeredComponent);
console.log(comp);
Expand Down

0 comments on commit ef45d2d

Please sign in to comment.