【问题标题】:Lint SCSS/SASS in single file components Vue.js in PhpStormLint SCSS/SASS 在 PhpStorm 中的单个文件组件 Vue.js 中
【发布时间】:2017-07-22 08:25:06
【问题描述】:

我正在使用带有单个文件组件方法的 Vue.js。我的 IDE 是 PhpStorm,我想找到一种方法,以便能够很好地识别 .vue 文件内的 <style></style> 中包含的 SCSS。

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

<template>
    ...
</template>

<script>

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

        },

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

【问题讨论】:

    标签: sass phpstorm lint vue.js


    【解决方案1】:

    我发现您的解决方案没有帮助。使用type="text/scss" 似乎可以为我解决这个问题,但如果其他人遇到问题。

    【讨论】:

    • 是的,type="text/scss" 完成了这项工作。这应该是正确的答案。上一个rel="stylesheet/scss" 不行。
    【解决方案2】:

    在我的情况下,两者都不起作用。

    尝试使用以下方法进行修复。

    &lt;style lang="scss" rel="stylesheet/scss" type="text/scss"&gt;

    【讨论】:

      【解决方案3】:

      我自己找到了答案:

      你需要添加rel="stylesheet/scss"所以看起来像

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-06-29
        • 2018-09-11
        • 2013-11-04
        • 1970-01-01
        • 2022-08-18
        • 1970-01-01
        • 2018-09-04
        • 2011-11-10
        相关资源
        最近更新 更多