售货机:扩展突变和页面组件状态
是否可以扩展任何页面的Vuex状态(突变和Getters)?我正在尝试为产品扩展(product.extension.mycustomentity)添加突变,但是到目前为止,我还没有发现任何涵盖此主题的文档或其他行为的组件。
Can the vuex state(mutations and getters) of any page such as sw-product-detail be extended? I'm trying to add mutation for product extensions(product.extension.myCustomEntity) but so far I have not found any docs covering this topic or other components doing a similar behavior.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们没有实施扩展Vuex国家的方法。造成这种情况的原因有几个,但是最重要的是,只有一个来源应确定状态的外观。如果您想像您现在正在做的那样,您想像了多个扩展,那就是您现在正在做的那样,事情就会破裂。
We did not implement a way to extend vuex states. There are several reasons for this, but the most important one is that only one source should determine how the state looks. If you imagine multiple extensions fiddling around with the state like you mentioned you are doing now, things will break.