Vue CLI 3.0 build and run index.html file without server

Actually, I am trying to run the generated files on the iPad(iPad without any network connection) without network connection using the html viewer, so I can’t run a server.

Note: Vue 3.0

Use hash mode in vue router.

I’ve tried many different ways for this but still, I couldn’t solve the issue, can you please show me an example of this?


module.exports = {
  // ...
  publicPath: './',
  // ...

sorry, i tried this solution many times and it doesn’t work. I’m about to go crazy now.

Use a combination of the two solutions above.

Ekran Resmi 2022-06-30 14.57.02
Ekran Resmi 2022-06-30 14.57.35

I did examples like top of the pictures. but giving an error under on picture.

working well (Vue2)
微信图片_20220701112320 微信图片_20220701112343


working well (Vue3)

Unfortunately, I couldn’t solve the problem. Could it be because my App.vue component is like the above?

This is pretty common code and won’t cause any problems.

I don’t use any API but it still gives a CROSS error.

i tried the combination and it worked for me. .