vue-loader不支持<style></style>里面写样式

.vue文件加载正常,但是如果在.vue里面用到<style></style>里面写样式,就会报错

<template>
    ...
</template>
<script>
    ...
</script>
<style>
    html {
        width: 50px;
        height: 50px;
        }
</style>

报错信息
Uncaught Error: Module parse failed: Unexpected token (136:5)
You may need an appropriate loader to handle this file type.
|
|
| html {
| width: 50px;
| height: 50px;

阅读 4.2k
4 个回答

安装 css-loader

css-loader 加了吗?

同样的问题,解决了吗?

安装css-loader、style-loader再试试

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题