gulp-file-include不起作用-@@ include

时间:2019-08-03 15:38:49

标签: gulp gulp-watch

我对文件包含有疑问。我有这段代码,路径绝对可以。

<div class="small-article clearfix">
    <a href="#"><img class="small-article-image" src=""
            data-src="@@image" alt=""></a>
    <div class="article-text">
        <span class="article-date">@@date<br></span>
        <span class="article-author">@@author</span>
        <h3 class="article-heading"><a href="#">@@heading</a>
        </h3>
    </div>
</div>
  @@include('../SmallArticlesItem/SmallArticlesItem.html',{
  "image": "images/theme/small-article-2.jpg",
  "date": "18. ledna 2019",
  "author": "- rodič",
  "heading": "Co si ohlídat na začátku školního roku –
          manuál"
  })

但是当我保存文件时,gulp-watch会抛出此错误

events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: Unexpected token C in JSON at position 113

但是当我仅包括它时,就可以了

 @@include('../SmallArticlesItem/SmallArticlesItem.html'

请问有人知道问题出在哪里吗? :)

0 个答案:

没有答案