Skip to content

Commit

Permalink
test: add to vue3 migration pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
annacv committed Jun 19, 2024
1 parent 84e2691 commit e811730
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/_vue3-migration-test/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
scrollXModule,
searchXModule,
semanticQueriesXModule,
identifierResultsXModule
identifierResultsXModule,
experienceControlsXModule
} from './';

// Warnings that cannot be solved in Vue 2 (a.k.a. breaking changes) are suppressed
Expand Down Expand Up @@ -95,7 +96,8 @@ createApp(App as Component)
queriesPreview: queriesPreviewXModule,
semanticQueries: semanticQueriesXModule,
recommendations: recommendationsXModule,
identifierResults: identifierResultsXModule
identifierResults: identifierResultsXModule,
experienceControls: experienceControlsXModule
}
})
.mount('#app');
8 changes: 7 additions & 1 deletion packages/_vue3-migration-test/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import {
TestSemanticQueries,
TestRecommendations,
TestNextQueries,
TestIdentifierResults
TestIdentifierResults,
TestExperienceControls
} from './';

const routes = [
Expand Down Expand Up @@ -236,6 +237,11 @@ const routes = [
path: '/identifier-results',
name: 'IdentifierResults',
component: TestIdentifierResults
},
{
path: '/experience-controls',
name: 'ExperienceControls',
component: TestExperienceControls
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as TestExperienceControls } from './test-experience-controls.vue';
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<span style="display: block">
Controls:
<b>{{ experienceControls }}</b>
</span>
<ExperienceControls />
<div v-for="(item, index) in items" :key="index">
<div>{{ item }}-{{ index }}</div>
</div>
</template>

<script setup>
import ExperienceControls from '../../../../../x-components/src/x-modules/experience-controls/components/experience-controls.vue';
import { useState } from '../../../../../x-components/src';
const experienceControls = useState('experienceControls', ['controls']);
const items = experienceControls.resultsPerCarousels;
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './components';
export * from './x-module';
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { PrivateXModuleOptions } from '../../../../x-components/src/plugins/x-plugin.types';
import { ExperienceControlsXModule } from '../../../../x-components/src/x-modules/experience-controls/x-module';

export const experienceControlsXModule: PrivateXModuleOptions<ExperienceControlsXModule> = {
storeModule: {
state: {
controls: { numberOfCarousels: 10, resultsPerCarousels: 6 },
events: { ColumnsNumberProvided: 6 },
status: 'initial',
params: {}
}
}
} as PrivateXModuleOptions<ExperienceControlsXModule>;
1 change: 1 addition & 0 deletions packages/_vue3-migration-test/src/x-modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export * from './query-suggestions';
export * from './semantic-queries';
export * from './recommendations';
export * from './identifier-results';
export * from './experience-controls';

0 comments on commit e811730

Please sign in to comment.