R
R
Renhor2019-04-03 17:58:31
Vue.js
Renhor, 2019-04-03 17:58:31

How to pass an image to a component?

Good afternoon! I am using webpack. Suppose you need to pass an image to the component, now I am passing the link using require("path_to_image"), because passing a string, for example - ./../../images/img - does not work. Am I doing the right thing, or are there other, better ways?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Renhor, 2019-04-10
@Renhor

The comments indicated that I am doing the principle correctly. We get the image require("path_to_image"), and pass it to the component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question