但是做完后运行在浏览器发现打开后为空白,而且会提示下载app.vue(就是我运行的文件的名字)
下载完后运行但是,又提示下载,无限循环。
如下图所示(左下角提示让下载(19)表示我已经试了19次了)
<template>
<div id="app">
<router-link to="/main">首页</router-link>
<router-link to="/content">内容页</router-link>
<router-link to="/wyc">wyc页</router-link>
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
import Vue from 'vue'
import VueRouter from 'vue-router'
import Content from '../components/content'
import Main from '../components/Main'
import wyc from '../components/wyc'
//安装路由
Vue.use(VueRouter);
//配置导出路由
export default new VueRouter({
routers:[
{
//路由路径
path:'/content',
name:'content',
//跳转的组件
component:Content
},
{
//路由路径
path:'/Main',
name:'main',
//跳转的组件
component:Main
},
{
//路由路径
path:'/wyc',
name:'wyc',
//跳转的组件
component:wyc
}
]
});
<template>
<h1>内容页</h1>
</template>
<script>
export default {
name: "content"
}
</script>
import Vue from 'vue'
import App from './App'
import router from './router'//自动扫描路由配置
Vue.config.productionTip = false;
new Vue({
el: '#app',
//配置路由
router,
components: { App },
template: '<App/>'
})
求知晓的大佬帮忙解决!!!
https://blog.csdn.net/for_weber/article/details/80414754
楼主解决了吗,我也有同样的问题
大佬,这个请问解决了吗,卡我要命。也是运行app.vue,浏览器下载,然后就没东西。
我不知道你的具体情况是啥,但是我问题跟你一样,我的解决方式时
IDEA里面我的vue显示的类型是html,但是名字没变,我重写类型,将类型改成了vue,显示的图标也是vue,然后修改运行和调试配置为自己需要的,然后成功了