我正在尝试收到有关在购物车中添加产品的通知,但收到此警告,不知道是什么原因造成的。
DevTools 无法加载 SourceMap:无法加载 http://localhost:3000/js/noty.js.map 的内容:HTTP 错误:状态代码 404,net::ERR_HTTP_RESPONSE_CODE_FAILURE
I have installed 'noty' using yarn
import axios from 'axios'
import Noty from 'noty'
function updateCart(pizza) {
axios.post('/update-cart', pizza).then(res => {
cartCounter.innerText = res.data.totalQty
new Noty({
type: 'success',
timeout: 1000,
text: 'Item added to cart',
progressBar: false,
}).show();
}).catch(err => {
new Noty({
type: 'error',
timeout: 1000,
text: 'Something went wrong',
progressBar: false,
}).show();
})
}
addToCart.forEach((btn) => {
btn.addEventListener('click', (e) => {
let pizza = JSON.parse(btn.dataset.pizza)
updateCart(pizza)
})
})
scss
@import '~noty/src/noty.scss';
@import '~noty/src/themes/mint.scss';
.noty_theme_mint {
border-radius: 50px!important;
padding-left: 8px!important;
}