【发布时间】:2021-01-13 14:11:07
【问题描述】:
我有一个带有按钮的应用程序,我想更改为不同的 Vue 文件。我的第一个 Vue 文件名为 app.vue。
<template>
<div id="app">
<button id="gettingStarted">Getting started</button>
</div>
</template>
<script>
export default {
name: 'App',
components: {
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
#gettingStarted {
font-family: Avenir, Helvetica, Arial, sans-serif;
background:cornflowerblue;
border-radius: 0.5rem;
height: 2.5rem;
width: 6%;
}
</style>
然后我有另一个名为 Gallery.vue 的文件
<template>
<div id="app">
<h4>25%</h4>
</div>
</div>
</template>
<script>
export default {
name: 'App',
components: {
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
所以在按钮上点击in-app.vue 我想去gallery.vue。我目前正在为这个项目使用 Vue3。
【问题讨论】:
-
这是 SPA 的一部分吗?
标签: javascript vue.js