小编Bri*_*ick的帖子

Nodemon 启动脚本并运行 eslint

我正在 Vue.JS 中启动一个项目,并且对 nodemon 有点陌生。

这是我的 package.json 文件

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "nodemon src/app.js --exec 'npm run eslint'",
    "lint": "eslint **/*.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "eslint": "^4.16.0",
    "nodemon": "^1.14.12"
  }
}
Run Code Online (Sandbox Code Playgroud)

我可以使用“nodemon src/app.js”让nodemon通过app.js运行。我在 --exec 之后尝试了一大堆组合,但没有任何运气。

node.js nodemon eslint

2
推荐指数
1
解决办法
7099
查看次数

使用CSS将伪类添加到nth-child

我想使用悬停,以便奇数div的底部边框是不同的颜色#75dcff.但是,.card:hover div:nth-child(odd)不起作用.我可以将psuedo类应用于nth-child元素吗?

.card {
  margin: 30px;
  padding: 20px 40px 40px;
  max-width: 500px;
  text-align: left;
  background: #fff;
  border-bottom: 4px solid #ccc;
  border-radius: 6px;
}

.card:hover {
  border-color: #75dcff;
}

.card:hover div:nth-child(odd) {
  border-color: #ff7c5e;
}
Run Code Online (Sandbox Code Playgroud)
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
Run Code Online (Sandbox Code Playgroud)

html css css-selectors pseudo-class

1
推荐指数
1
解决办法
271
查看次数

Nodemon''npm'未被识别为内部或外部命令

我意识到这很可能是一个重复的问题.我是nodemon的新手,我正在尝试使用nodemon为Vue JS项目建立一个服务器.我正在尝试使用nodemon运行eslint,并且无法弄清楚为什么我一直收到错误消息.如果我在--exec之后删除npm它将告诉我''run'无法识别,如果我删除了我将得到''lint'不被识别等等.我的package.json文件:

{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "nodemon src/app.js --exec 'npm run lint && node'",
    "lint": "eslint **/*.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "eslint": "^4.16.0",
    "nodemon": "^1.14.12"
  }
}
Run Code Online (Sandbox Code Playgroud)

我也在我的启动脚本中尝试了这段代码:

   "scripts" : {
      "start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
      "lint": "./nodemodules/.bin/eslint **/*.js"
    } 
Run Code Online (Sandbox Code Playgroud)

在哪里告诉我"." 不被视为内部外部命令.我已经将nodemon安装到我的服务器文件夹和项目目录以及全局.我也用eslint做了同样的事情.

node.js nodemon eslint

1
推荐指数
2
解决办法
1741
查看次数

将标记添加到将进入标记集群的 Google 地图

我添加了 4 个位置,当页面加载并缩小时,它们将聚集成 4 个一组。

我添加了一个单击事件来向地图添加标记。我无法让这些添加的标记成为标记簇,就像我放入脚本中的 4 个位置一样。

我怎么做?

<div id="mapContainer">
  <div id="map"></div>
</div>

<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://www.gstatic.com/firebasejs/4.3.1/firebase.js"></script>
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCbdYz0sVFHyKAMVP051D_UI1PsbxQ92n8&callback=initMap"></script>
<script>
  function initMap() {
    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 8,
      center: {lat: 33.034405, lng: -117.292928}
    });
    // Create an array of alphabetical characters used to label the markers.
    var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    // Add some markers to the map.
    // Note: The code uses the JavaScript Array.prototype.map() method to
    // create an …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-maps-api-3 markerclusterer

0
推荐指数
1
解决办法
2982
查看次数