question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[HELP] Confused about how to use component assets

See original GitHub issue

First 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:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SimulatedGREGcommented, May 27, 2017

@voveson

Since a *.mp3 isn’t handled by webpack and vue-loader isn’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 the dev branch (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).

0reactions
vovesoncommented, May 27, 2017

Thanks for your help, Greg!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found