Javascript 删除附加到URL的自动#/

Javascript 删除附加到URL的自动#/,javascript,vue.js,frontend,Javascript,Vue.js,Frontend,我是vue js的新手。我已使用vue cli 3创建了一个项目 例如,生成的URL末尾包含#/ 为了摆脱尾随#/,我在router.js文件中尝试了模式:“history”,并在根目录中添加了.htaccess文件,代码如下: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !

我是vue js的新手。我已使用vue cli 3创建了一个项目

例如,生成的URL末尾包含#/ 为了摆脱尾随#/,我在router.js文件中尝试了
模式:“history”
,并在根目录中添加了.htaccess文件,代码如下:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

重新启动发动机
重写基/
重写规则^index\.html$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.html[L]
但它返回一个空白页,没有任何错误

有人能帮我更换吗

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

我添加了FallbackResource/index.html,但仍然得到一个空白页面
FallbackResource /index.html