我正在 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 之后尝试了一大堆组合,但没有任何运气。
我想使用悬停,以便奇数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)
我意识到这很可能是一个重复的问题.我是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做了同样的事情.
我添加了 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)