Skip to content

Commit

Permalink
beautified vue demo
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsboost committed Aug 6, 2024
1 parent ce2d735 commit 4b281ef
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 60 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified go/.DS_Store
Binary file not shown.
58 changes: 29 additions & 29 deletions go/dist/App.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/dist/App.js.map

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions go/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ const project = onChange(p, (property, oldValue, newValue) => {
// render right away
if (initRun.includes(string)) {
if (string === 'javascript') {
renderPreview(true);
if (project.autorun) renderPreview(true);
if (!window.editorManager) return;
if (window.editorManager.jsEditor.state.doc.toString() !== project.javascript) {
dispatchChanges(editorManager.jsEditor, project.javascript);
Expand Down Expand Up @@ -2106,34 +2106,34 @@ root.render(<App />);`;
project.html = `<div id="root"></div>`;
project.css = ``;
project.javascript = `const App = {
data() {
return {
counter: 0,
message: '👋 Hello, ${capitalizedTitle}! 🌎'
};
},
methods: {
incrementCounter() {
this.counter++;
}
},
template: \`
<div class="flex flex-col items-center justify-center absolute inset-0">
<h1 class="text-3xl font-thin mb-4">{{ message }}</h1>
<p class="text-xl mb-4">Counter: <span id="counter" class="font-mono">{{ counter }}</span></p>
<button
id="incrementButton"
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition"
@click="incrementCounter"
>
+
</button>
</div>
\`
};
const app = Vue.createApp(App);
app.mount('#root');`;
data() {
return {
counter: 0,
message: '👋 Hello, ${capitalizedTitle}! 🌎'
};
},
methods: {
incrementCounter() {
this.counter++;
}
},
template: \`
<div class="flex flex-col items-center justify-center absolute inset-0">
<h1 class="text-3xl font-thin mb-4">{{ message }}</h1>
<p class="text-xl mb-4">Counter: <span id="counter" class="font-mono">{{ counter }}</span></p>
<button
id="incrementButton"
class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition"
@click="incrementCounter"
>
+
</button>
</div>
\`
};
const app = Vue.createApp(App);
app.mount('#root');`;
}
if (name === 'preact') {
project.meta = `<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js" defer></script>`;
Expand Down

0 comments on commit 4b281ef

Please sign in to comment.