Following the new readme, I'm suddenly receiving this when I compile.
"vue-multiselect": "2.0.0-beta.14",
From one of my files, I've added the below line per the new readme for beta.14
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
This doesn't work if using gulp, vueify and .vue files. Has anybody figured out how to make this work in a compiled .vue file?
This is an example used with a module bundler like webpack. If you don’t have one – just add the files as a static @import somewhere in your main.css file.
It worked for me in a Vue file (Laravel Mix), however, I had to reference the npm module and not some other project location. So:
<template>
<div>
... [code]
</div>
</template>
<script>
export default {
... [code]
}
</script>
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
Note that the Laravel Mix bundler assumes these files are located under node_modules project folder. I could never get it to pull in from anywhere else, which probably requires some adjustment to the webpack configuration. Also, I had to make sure I was on the latest Node/npm, and also, Mix plugin. Finally, recently I have had to delete and reinstall my node modules due to problems with the vue-loader plugin. That helped.
Or per plugin author, you can just include the raw css in the <head></head> project layout app.
I got it to work, but for some reason, browserify / vueify (I'm still using laravel elixir, 1 release behind), could not find the .css file. I had to put in a full path:
This worked.
Weird. Browserify should be able to resolve other files within a node module, without specifying the relative path. This might be a problem in your setup.
@OliverGrimsley -- If you note, my issue indicates having done exactly what you did... so I'm not sure what you're pointing out.
@ryanrca @shentao It WAS working using gulp/vueify but then suddenly stopped, hence my post. I still haven't narrowed down which dependency might have changed causing this.
Sorry, I was not very clear. Mine initially did not work either. I had to update Node, vue-loader (for style sheets) and npm for it to work in webpack. In fact, I had to delete my whole node module directory and re-install it, because something changed in vue-loader and my entire build process stopped working. Anyway, after I updated everything, the css loaded into the component fine. I do not use gulp so no idea if that tool will work.
Most helpful comment
It worked for me in a Vue file (Laravel Mix), however, I had to reference the npm module and not some other project location. So:
Note that the Laravel Mix bundler assumes these files are located under
node_modulesproject folder. I could never get it to pull in from anywhere else, which probably requires some adjustment to the webpack configuration. Also, I had to make sure I was on the latest Node/npm, and also, Mix plugin. Finally, recently I have had to delete and reinstall my node modules due to problems with the vue-loader plugin. That helped.Or per plugin author, you can just include the raw css in the
<head></head>project layout app.