在 vue.config.js
中通过如下配置设置页面标题:
chainWebpack: (config) => {
config
.plugin('html')
.tap((args) => {
args[0].title = 'Custom Title';
return args;
});
}
然后在 html
页面中使用 <%= htmlWebpackPlugin.options.title %>
引用该配置。
网友评论