0
I need to import a local source for my project on Vue
, and I am not succeeding. I tried using the @font-face
, in that way:
@font-face {
font-family: 'Oxygen';
src: url('../fonts/Oxygen-Regular.woff2') format('woff2');
src: url('../fonts/Oxygen-Regular.woff') format('woff');
font-weight: normal;
}
I put without the url
, imported in a file styles
, and direct in the component App
, tried also putting the font-face
right into the component that would use the source, and it didn’t work. Someone could tell me the correct way to import local sources using the Vue
via cli
?
gave the right answer?
– novic
did not, because to import the font on @font-face, it was not working. answered below as I could
– Carol Libório
Look my answer was tested on Vuejs and it worked! has nothing to do with what you said in your reply!
– novic
Are you using Vue-cli? Because mine only worked that way, and I’m using Vue by Vue-cli. your answer didn’t work.. has this link here explaining this tbm https://qastack.com.br/programming/42749973/es6-import-using-at-sign-path-in-a-vue-js-project-using-webpack
– Carol Libório
yes it is by Vue-cli, it works yes ... if you are mistaken, the way you did it is the traditional, but the other way works.
– novic
I understand, but in the project here did not work with this way, only using the @ even for the paths.
– Carol Libório