这篇文章上次修改于 1104 天前,可能其部分内容已经发生变化,如有疑问可询问作者。
在 vue.config.js
中通过如下配置设置页面标题:
chainWebpack: (config) => {
config
.plugin('html')
.tap((args) => {
args[0].title = 'Custom Title';
return args;
});
}
然后在 html
页面中使用 <%= htmlWebpackPlugin.options.title %>
引用该配置。
没有评论