-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work for #5551 - Implement TOC navigation - added TOC navigation to vue
- Loading branch information
Showing
4 changed files
with
81 additions
and
39 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,38 @@ | ||
<template> | ||
<div className="sd-components-column"> | ||
<template v-for="(component, index) in components"> | ||
<component | ||
:is="component.component" | ||
:survey="survey" | ||
:model="component.data" | ||
></component> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from "vue"; | ||
import { Component, Prop, Watch } from "vue-property-decorator"; | ||
import { SurveyModel } from "survey-core"; | ||
import { BaseVue } from "../base"; | ||
@Component | ||
export class ComponentsContainer extends BaseVue { | ||
@Prop() survey: SurveyModel; | ||
@Prop() container: string; | ||
components: Array<any>; | ||
constructor() { | ||
super(); | ||
this.components = this.survey.getContainerContent(this.container as any); | ||
} | ||
@Watch("survey") | ||
@Watch("container") | ||
onPropertyChanged(value: string, oldValue: string) { | ||
this.components = this.survey.getContainerContent(this.container as any); | ||
} | ||
} | ||
Vue.component("sv-components-container", ComponentsContainer); | ||
export default ComponentsContainer; | ||
</script> |
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,26 @@ | ||
<template> | ||
<div :class="containerCss"> | ||
<sv-list :model="listModel"></sv-list> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from "vue"; | ||
import { Component, Prop } from "vue-property-decorator"; | ||
import { SurveyModel, createTOCListModel } from "survey-core"; | ||
@Component | ||
export class ProgressToc extends Vue { | ||
@Prop() survey: SurveyModel; | ||
@Prop() css: any; | ||
containerCss = ""; | ||
public listModel: any = undefined; | ||
constructor() { | ||
super(); | ||
this.listModel = createTOCListModel(this.survey); | ||
} | ||
} | ||
Vue.component("sv-progress-toc", ProgressToc); | ||
export default ProgressToc; | ||
</script> |
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