-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
73 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Compare as CompareModule } from '..' | ||
import compareMountedMixin from '@vue-storefront/core/modules/compare/mixins/compareMountedMixin' | ||
|
||
export const IsOnCompare = { | ||
name: 'IsOnCompare', | ||
mixins: [compareMountedMixin], | ||
props: { | ||
product: { | ||
required: true, | ||
type: Object | ||
} | ||
}, | ||
created () { | ||
CompareModule.register() | ||
}, | ||
computed: { | ||
isOnCompare () { | ||
return this.$store.getters['compare/isOnCompare'](this.product) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
import Product from '@vue-storefront/core/modules/catalog/types/Product' | ||
import { Compare as CompareModule } from '..' | ||
import compareMountedMixin from '@vue-storefront/core/modules/compare/mixins/compareMountedMixin' | ||
import Product from '@vue-storefront/core/modules/catalog/types/Product'; | ||
import { Compare as CompareModule } from '..'; | ||
import compareMountedMixin from '@vue-storefront/core/modules/compare/mixins/compareMountedMixin'; | ||
|
||
export const RemoveFromCompare = { | ||
name: 'RemoveFromCompare', | ||
mixins: [compareMountedMixin], | ||
props: { | ||
product: { | ||
required: true, | ||
type: Object | ||
} | ||
}, | ||
methods: { | ||
removeFromCompare (product: Product) { | ||
CompareModule.register() | ||
this.$store.dispatch('compare/removeItem', product) | ||
CompareModule.register(); | ||
this.$store.dispatch('compare/removeItem', product); | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { GetterTree } from 'vuex' | ||
import RootState from '@vue-storefront/core/types/RootState' | ||
import WishlistState from '../types/WishlistState' | ||
|
||
const getters: GetterTree<WishlistState, RootState> = { | ||
isOnWishlist: state => product => | ||
state.items.some(p => p.sku === product.sku), | ||
isWishlistLoaded: state => state.loaded, | ||
getWishlistItemsCount: state => state.items.length | ||
} | ||
|
||
export default getters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters