| | |
| | | :topic-title="activeTopic && activeTopic.title" |
| | | :text="activeTopic && activeTopic.fullText" |
| | | ></active-element> |
| | | <knowledge-base :topics="topics" @select-topic="activateTopic"></knowledge-base> |
| | | <knowledge-base @select-topic="activateTopic"></knowledge-base> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | activeTopic: null, |
| | | }; |
| | | }, |
| | | provide(){ |
| | | return { |
| | | topics: this.topics |
| | | } |
| | | }, |
| | | methods: { |
| | | activateTopic(topicId) { |
| | | this.activeTopic = this.topics.find((topic) => topic.id === topicId); |
| | | }, |
| | | }, |
| | | mounted(){ |
| | | setTimeout(() => { |
| | | this.topics.push({ |
| | | id: 'events', |
| | | title: 'Events', |
| | | description: 'Vieni all\'evento', |
| | | fullText: |
| | | 'Gli eventi ti permettono di triggherare il codice on demand', |
| | | }); |
| | | }, 3000); |
| | | } |
| | | }; |
| | | </script> |
| | | |