跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • ESLint: clear(vue/comment- directive) 是什么鬼?
未分類
9 11 月 2020

ESLint: clear(vue/comment- directive) 是什么鬼?

ESLint: clear(vue/comment- directive) 是什么鬼?

資深大佬 : shakukansp 0

vue 文件:<template src=”./detail-page.html”></template>

html 文件:<div>hello world</div>

eslint 会在最后报一个 ESLint: clear(vue/comment- directive)

大佬有話說 (4)

  • 資深大佬 : wunonglin

    最外层的 template 能用 src ?是我孤陋寡闻了?

  • 主 資深大佬 : shakukansp

    @wunonglin 这是在 vue 文件里
    <template src=”./detail-page.html”></template>
    <style scoped src=”./detail-page.scss” lang=”scss”></style>
    这么写毫无问题啊

    这个报错也是升级 eslint 的包以后莫名出现的

  • 資深大佬 : wunonglin

    @shakukansp #2

    好吧,一直以为只有 style 能写其他地方,如果 html 分离写,ide 的提示还有吗?

    你那个 eslint 的错误说明在这,https://eslint.vuejs.org/rules/comment-directive.html 搜一下就有了

  • 主 資深大佬 : shakukansp

    @wunonglin webstorm 能提示,vue 2.x.x 的

    说明我看过了……摸不着头脑,搜了半天只有 segmentfault 的 1010000037552955 提到这个
    共同点是都是 html 报错,但是那个问题没有正解
    而且这 html 就一个标签里面一行 text

    文档里的说明就是这个规则是支持检测在 template 下 disable next-line 这类功能的,但是我没注释(

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具