gpt4 book ai didi

webpack - scss 不适用于 vue3 应用程序(TypeError : this. getOptions 不是函数)

转载 作者:行者123 更新时间:2023-12-05 01:08:05 25 4
gpt4 key购买 nike

我正在尝试在 vue3 应用程序中使用 scss。我收到以下错误。

./src/components/SinglePost.vue?vue&type=style&index=0&id=164ef990&lang=scss(./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader-v16/dist/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/SinglePost.vue?vue&type=style&index=0&id=164ef990&lang=scss)Module build failed (from ./node_modules/sass-loader/dist/cjs.js):TypeError: this.getOptions is not a functionat Object.loader (/usr/src/app/node_modules/sass-loader/dist/index.js:25:24)

我已按照 https://vue-loader.vuejs.org/guide/pre-processors.html 上的说明进行操作页。我正在使用 vue-cli-service serve 来启动服务器。singlepost.vue 中的代码如下,如果使用这个命令启动服务,我不确定是否需要创建 webpack.config.js 文件。

<style lang="scss">
.btn {
&,
&:link,
&:visited {
text-transform: uppercase;
text-decoration: none;
padding: 1.5rem 4rem;
display: inline-block;
border-radius: 10rem;
transition: all .3s;
position: relative;
//
}
.....etc etc
</style>

请指导我,我是网络开发的新手。

最佳答案

或运行

npm install -D sass-loader@10.1.1 sass

关于webpack - scss 不适用于 vue3 应用程序(TypeError : this. getOptions 不是函数),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66521686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com