[英]How to build files for two HTML pages using Vue?
Right now, I have two HTML files I want to build.现在,我有两个要构建的 HTML 文件。 My project structure is like so.
我的项目结构是这样的。
|- node_modules
|- public
| |- blog
| | |- some-page.html
| |- index.html
|- src (contains all the Vue components)
|- Blog.Vue
|- Index.Vue
|- main.js
In my some-page.html
, I have a div
with the ID blog
and in my index.html
file, I have a div
with the ID app
.在我的
some-page.html
中,我有一个 ID 为blog
的div
,在我的index.html
文件中,我有一个 ID 为app
的div
。 Then, in my main.js
, I have this code.然后,在我的
main.js
中,我有这段代码。
import Vue from 'vue';
import Index from './Index.vue';
import Blog from './Blog.vue';
import vuetify from './plugins/vuetify';
Vue.config.productionTip = false;
new Vue({
vuetify,
render: (h) => h(Index),
}).$mount('#app');
new Vue({
vuetify,
render: (h) => h(Blog),
}).$mount('#blog');
When I build the project, the some-page.html
doesn't get updated at all.当我构建项目时,
some-page.html
根本没有得到更新。 The index.html
page works fine. index.html
页面工作正常。 How can I make it so when I build the project, the some-page.html
is also injected with the Vue component?我怎样才能做到这一点,当我构建项目时,
some-page.html
也注入了 Vue 组件? I want to upload the built files to my server for hosting for my personal experimentation of using Vue.我想将构建的文件上传到我的服务器以托管我个人使用 Vue 的实验。
I have the source code published on Github here: https://github.com/171112542/seo我在 Github 上发布了源代码: https://github.com/171112542/seo
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.