Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local image load error #27

Open
birdmanmandbir opened this issue Dec 26, 2021 · 5 comments
Open

local image load error #27

birdmanmandbir opened this issue Dec 26, 2021 · 5 comments

Comments

@birdmanmandbir
Copy link

birdmanmandbir commented Dec 26, 2021

Problem

I use a simple local img '../assets/pano.png', it load nothing but black screen, and in devtools it send a XHR request, not a image request
But if I use img from online resource, it work

This is my vue file.

<template>
  <div class="vr-container">
    <Pano
      :source="url"
      class="pano"
    ></Pano>
    <!-- <img src="../assets/pano.png" alt="pano" /> -->
  </div>
</template>
<script>
import { Pano } from "vuejs-vr";
export default {
  components: { Pano },
  data() {
    return {
      url: "../assets/pano.png",
    //   url: "https://t4.ftcdn.net/jpg/02/09/58/11/360_F_209581186_UIHxT8WvyXZbTbHnNeEu4SFRQ3TdqBHA.jpg",
    };
  },
};
</script>

<style scoped>
body {
  height: 1080px;
}
.vr-container {
    height: 100vh;
    width: 100vw;
}
.pano {
    height: 80%;
    width: 80%;
}
</style>

Please give me some suggestions, thanks!
image

@mudin
Copy link
Owner

mudin commented Dec 26, 2021

@birdmanmandbir What is your file structure?
"../assets/pano.png" seems not correct url

@birdmanmandbir
Copy link
Author

@birdmanmandbir What is your file structure? "../assets/pano.png" seems not correct url
this is my file structure, I used a relative path.
I'm using windows 11, is this a problem?
image

@mudin
Copy link
Owner

mudin commented Dec 28, 2021

@birdmanmandbir Could you try to change url to "/assets/pano.png" or "assets/pano.png"

@birdmanmandbir
Copy link
Author

birdmanmandbir commented Dec 28, 2021

@birdmanmandbir Could you try to change url to "/assets/pano.png" or "assets/pano.png"

I have tried /assets/pano.png, assets/pano.png and ./assets/pano.png, all of them are not work. 😢
Maybe I can create a repo on github, and you can clone and check it. Thanks for your help:satisfied:

@birdmanmandbir
Copy link
Author

@birdmanmandbir Could you try to change url to "/assets/pano.png" or "assets/pano.png"

This is my repo: https://github.com/birdmanmandbir/Vue-learn
It's a simple project create by vue-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants