[HELP] Confused about how to use component assets
See original GitHub issueFirst of all, serious kudos for your work on this project!
Describe the issue / bug.
I’m trying to follow the instructions here, specifically where it says to create a directory with the same name as your Vue component, then a subdirectory called assets, and include the component’s assets there. I’m just not sure where to go from there – how do I access the asset from the Vue component?
Specifically, I am trying to customize the Notification sound using an .mp3 asset. If there’s a better way to accomplish that, please point me in the right direction!
Tell me about your development environment.
- Node version: v6.8.1
- NPM version: v3.10.8
- Operating System: Mac osX El Capitan
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Understanding the parts of a Design System: tokens, assets ...
A token is a raw material or tool we use to build more complex elements like assets, components and patterns. Some examples of...
Read more >Definition of component assets
A component asset is used to link asset information, which is summarized in an aggregate asset. To add, delete, and access the component...
Read more >How to create and use components in Figma for beginners
Determine the way your component would look in terms of color — Determining the color of the component doesn't have to be only...
Read more >How to record components used to build a computer
This computer component or the computer as a whole can be recorded as a fixed asset. You'll have to use the Fixed asset...
Read more >Dependencies and assets | Fliplet Developers Documentation
Dependencies and assets. Both components and themes can specify a list of dependencies and local assets which should be used when rendering it....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@voveson
Since a
*.mp3isn’t handled bywebpackandvue-loaderisn’t parsing assets in your JS, this won’t be possible in development or production. Because the asset isn’t being handled, it will never reach the final production build. The sound file would need to be treated as a static asset and referenced accordingly with a path to the asset. The current state of electron-vue doesn’t provide much help for getting a path to your assets. The next milestone release in thedevbranch (coming rather soon, #171) has made some major adjustments to help support these type of situations. Here is a link to the documentation that will launch with the next milestone release (https://simulatedgreg.gitbooks.io/electron-vue/content/v/9772e38a3e73c5610ba845b2d07103d1b2a7a29d/en/using-static-assets.html#use-case-within-js-with-fspath-and-static).Thanks for your help, Greg!