Skip to content

Commit

Permalink
chore: coms
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofmagic committed Jul 15, 2024
1 parent d5f050e commit b04e6a9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
19 changes: 18 additions & 1 deletion apps/vue-app/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script setup lang="ts">
function setHref(href: string) {
window.location.href = href
}
</script>

<template>
Expand All @@ -26,6 +28,21 @@
<RouterLink to="/bar">
Bar
</RouterLink>
<h2>
window.location.href
</h2>
<button @click="setHref('/')">
Index
</button>
<button @click="setHref('/foo')">
Foo
</button>
<button @click="setHref('/bar')">
Bar
</button>
<!-- <a href="/">Index</a>
<a href="/foo">Foo</a>
<a href="/bar">bar</a> -->
</div>
</div>
</template>
Expand Down
16 changes: 15 additions & 1 deletion apps/vue2-app/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script setup lang="ts">
function setHref(href: string) {
window.location.href = href
}
</script>

<template>
Expand All @@ -24,6 +26,18 @@
<RouterLink to="/bar">
Bar
</RouterLink>
<h2>
window.location.href
</h2>
<button @click="setHref('/')">
Index
</button>
<button @click="setHref('/foo')">
Foo
</button>
<button @click="setHref('/bar')">
Bar
</button>
</div>
</div>
</template>
Expand Down

0 comments on commit b04e6a9

Please sign in to comment.