vue教程:修改标题(vue.config.js)

说明

修改 index.html 的 <title>,如下图:

代码

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  pages: {
    index: {
      // page 的入口,必须写,否则报错
      entry: 'src/main.js',
      // 当使用 title 选项时,
      // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
      title: '测试标题',
    },
  }
})

原文出处:/show_1IX8YaBJ7Pf4.html