我想将这个烤面包-library连接到我的组件中:
my-component.vue
<script>
import toastr from 'toastr';
export default {
mounted(){
toastr.success('Hello from toastr!');
}
}
</script>
<template>
<div>
Template for my-component.vue here.
</div>
</template>
<style>
/* HOW TO IMPORT `toastr.css` FROM NODE_MODULES HERE?
</style>如何从node_modules目录连接库的css?
发布于 2017-11-18 11:53:36
正如@LinusBorg在vue-加载程序讨论线程中建议的那样,您可以在<style>-tag中使用src-attribute:
my-component.vue
<script>
import toastr from 'toastr';
export default {
mounted(){
toastr.success('Hello from toastr!');
}
}
</script>
<template>
<div>
Template for my-component.vue here.
</div>
</template>
<style src='toastr/build/toastr.min.css'></style>https://stackoverflow.com/questions/47365741
复制相似问题