2

I am trying to import 2 css files in style tag of my vue js single file component.

<style >
    @import '../assets/styles/jquery-ui.js.css';
    @import '../assets/styles/jquery-ui.css';
</style>

but the is throwing error saying:

ERROR Failed to compile with 1 errors
9:28:42 AM

error in ./src/components/Attend.vue

Syntax Error: Unclosed string

@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-5d10c7ca","scoped":false,"hasInlineConfig":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Attend.vue 4:14-308 13:3-17:5 14:22-316 @ ./src/components/Attend.vue @ ./src/router/index.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

1 Answer 1

0

Base on webpack, after compiling all the files inside your assets folder will be pack into static folder. Therefore when you import files/css/images in your component, your relative path is '../static/styles/jquery-ui.js.css'.

Therefore your code should be like this:

<style >
    @import "../static/styles/jquery-ui.js.css";
    @import "../static/styles/jquery-ui.css";
</style>
Sign up to request clarification or add additional context in comments.

1 Comment

thanks can you also please help me with stackoverflow.com/q/53967042/3311276 .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.