运行构建后,我将文件夹名称dist复制到xampp / htdocs / example并更改index.html
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel=icon href=/example/favicon.ico> <title>lotus</title>
<link href=/example/css/app.ed3040f3.css rel=preload as=style>
<link href=/example/css/chunk-vendors.95f634dc.css rel=preload as=style>
<link href=/example/js/app.eeff9a1c.js rel=preload as=script>
<link href=/example/js/chunk-vendors.de985e5e.js rel=preload as=script>
<link href=/example/css/chunk-vendors.95f634dc.css rel=stylesheet>
<link href=/example/css/app.ed3040f3.css rel=stylesheet>
</head>
<body><noscript><strong>We're sorry but lotus doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong></noscript>
<div id=app></div>
<script src=/example/js/chunk-vendors.de985e5e.js> </script> <script src=/example/js/app.eeff9a1c.js> </script>
</body> </html>
在空白页之后,我尝试创建新项目并将代码推送到新项目下,我的代码为空白,但仅显示HelloWorld
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<div>
<router-view></router-view>
</div>
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld.vue";
export default {
name: "app",
components: {
HelloWorld
}
};
</script>