請問如何移除預設路由後面帶的 # 字號?

目前專案預設路由會自帶一個#字號, ex. “http://localhost:8080/#/
build 之後上傳到伺服器也會有帶一個 # , ex. “https://domain/#

看了 config 裡有設定 path 的地方, 想請問要如何刪除預設 #

 dev: {
    // Paths
    assetsSubDirectory: "static",
    assetsPublicPath: "/",
    proxyTable: {},

    // Various Dev Server settings
    host: "localhost", // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
}

https://router.vuejs.org/zh/guide/essentials/history-mode.html#html5-history-模式

1 Like

謝謝你 幫很多忙:pray: