博主经过一夜的奋斗终于解决了很多nuxt的问题,参数的传递,刷新页面重新渲染,数据请求等
不多说直接上代码
在pages添加 index.vue
<template>
<section class="container">
<div>
<app-logo/>
<div class="links">
<button @click='login' class="button button-caution">点我</button>
</div>
</div>
</section>
</template>
<script>
import AppLogo from '~/components/AppLogo.vue'
import axios from 'axios'
export default {
components: {
AppLogo
},
methods: {
login () {
axios({
withCredentials: true,
method: 'get',
url: `url`,
}).then((res) => {
this.$router.push('/show')
})
}
}
}
</script>
在pages添加show.vue
<template id="app">
&l