vue报错说:
[Vue warn]: Extraneous non-emits event listeners (addToCart) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.
解决方法:
在 template: ``最外层再加一个<div></div>把内容包裹起来即可