Comments (8)
To use a image it must be included in the directory given to gotron.New("webapp")
and referenced using a relative path to webapp
. Everything in webapp
is exposed by a fileserver when given to electron.
webapp/
img/
img.png
index.html
In index.html
(or some imported js code) reference your img like this..
<img src="img/img.png"></img>
If you are using example/main.go
put your image inside example/ui/build
or use your own directory containing your application.
from gotron.
I'm Using vuecli3 when I put in my components in src/views/Home.vue I can't call the images using this annotations
<img alt="Vue logo" src="@/assets/logo.png"> don't work
<img alt="Vue logo" src="../assets/logo.png"> don't work
But if I put the image in src/app.vue using this form import it's work
<img alt="Vue logo" src="@/assets/logo.png"> work
<img alt="Vue logo" src="../assets/logo.png"> work
from gotron.
I'm not too familiar with vue. Guess this related to the way you build your project? Are other components in Home.vue displayed correctly?
Can provide a complete example?
from gotron.
Guess this related to the way you build your project?
Yes, but in pure vue it's work
Are other components in Home.vue displayed correctly?
Yes, other things running correctly
Can provide a complete example?
https://github.com/rafaelgfirmino/gotron-vue
You can see the file src/App.vue where I call the image and it come correctly.
The problem is when I call the image in src/components/Home.vue.
from gotron.
I just took your example and followed the steps you provided. This is what I see after running go run main.go
:
from gotron.
Sorry, @puengel you need click in home for where is the wrong image.
from gotron.
Hey @rafaelgfirmino , I found the cause of your problem.
https://github.com/rafaelgfirmino/gotron-vue/blob/master/src/router.js line 8:
mode: 'home',
should not be used in electron apps. If you remove this line your code works just fine.
Closing this issue as it is not a gotron issue.
from gotron.
Thanks man !
from gotron.
Related Issues (20)
- copy.Perm undefined HOT 1
- Using gotron-builder failed HOT 5
- gotron-builder failed with --win, on mac HOT 4
- gotron-builder fails on windows HOT 1
- gotron-builder fails on windows HOT 9
- Notes for install with godep HOT 3
- Changing application icon HOT 7
- Gotron-builder does not create a self-contained application HOT 2
- hang up on Ubuntu 19.04 HOT 2
- Refactor window.On to accept String as Event
- Apps using Gotron
- file actions (e.g., drag and drop)
- Typescript-vue example
- fork/exec node_modules/.bin/electron-builder: no such file or directory: HOT 1
- Is this project still maintained? HOT 2
- Cannot find .gotron/node_modules/.bin/electron on first run HOT 1
- chmod .gotron/assets: operation not permitted HOT 2
- Can send values to backend? HOT 1
- Arch: 'error while loading shared libraries: libgconf-2.so.4'
- Is this project still going on HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gotron.