| | |
| | | >Add Resource</base-button |
| | | > |
| | | </base-card> |
| | | <KeepAlive> |
| | | <component :is="selectedTab"></component> |
| | | </KeepAlive> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | provide() { |
| | | return { |
| | | resources: this.storedResouces, |
| | | addResource: this.addResource, |
| | | }; |
| | | }, |
| | | methods: { |
| | | setSelectedTab(tab) { |
| | | this.selectedTab = tab; |
| | | }, |
| | | addResource(title, description, url) { |
| | | const newResource = { |
| | | id: new Date().toISOString(), |
| | | title: title, |
| | | description: description, |
| | | link: url, |
| | | }; |
| | | |
| | | this.storedResouces.unshift(newResource); |
| | | this.selectedTab = 'stored-resources'; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |