在PhpStorm中的单个文件组件Vue.js中的Lint SCSS / SASS

时间:2017-03-02 14:40:19

标签: sass phpstorm lint vue.js

我使用Vue.js采用单一文件组件方法。我的IDE是PhpStorm,我想找到一种方法,以便<style></style>文件中的.vue中包含的SCSS得到很好的识别。

目前它看起来像我附上的图片 - 我不知道它是安装插件还是在PhpStorm中更改设置。

<template>
    ...
</template>

<script>

    export default {
        name: 'Tree',
        components: {

        },

    }
</script>
<style lang="scss">
   ... My SASS / SCSS / CSS
</style>

enter image description here

3 个答案:

答案 0 :(得分:5)

我发现你的解决方案没有帮助。如果有其他人遇到麻烦,使用type="text/scss"似乎可以解决它。

答案 1 :(得分:1)

在我的情况下两者都没有用。

尝试使用以下内容进行修复。

<style lang="scss" rel="stylesheet/scss" type="text/scss">

答案 2 :(得分:0)

我自己找到了答案:

您需要添加rel="stylesheet/scss",使其看起来像

<style lang="sass" rel="stylesheet/scss"></style>

OR

 <style lang="scss" rel="stylesheet/scss"></style>