import {PlatformSelect} from './platform-select'; import {ThemeSelect} from './theme-select'; export const PatternsPage = { props: ['query'], template: `

Patterns

`, data: () => ({ patterns: [] }), components: { 'platform-select': PlatformSelect, 'theme-select': ThemeSelect }, created() { // Load patterns data. this.patterns = window.patterns; }, computed: { filterPatterns() { const patterns = this.patterns; if (this.query.platform === 'android') { return patterns.filter(function(pattern) { return pattern.name.match(/Material/); }); } else if (this.query.platform === 'ios') { return patterns.filter(function(pattern) { return !pattern.name.match(/Material/); }); } return patterns; } }, };