mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-21 07:16:15 -04:00
feat: externalized tool configuration
This commit is contained in:
parent
c3adfe30ec
commit
690bd099ef
31 changed files with 387 additions and 300 deletions
|
@ -1,16 +1,21 @@
|
|||
<script lang="ts">
|
||||
import {Component, Vue} from 'nuxt-property-decorator'
|
||||
import {Component, mixins} from 'nuxt-property-decorator'
|
||||
import ToolWrapper from '~/components/ToolWrapper.vue'
|
||||
import type {ToolConfig} from '~/types/ToolConfig'
|
||||
import {ToolConfigMixin} from '~/mixins/tool-config.mixin'
|
||||
|
||||
@Component({components: {ToolWrapper}})
|
||||
export default class Tool extends Vue {
|
||||
@Component({
|
||||
components: {ToolWrapper}
|
||||
})
|
||||
export default class Tool extends mixins(ToolConfigMixin) {
|
||||
config(): ToolConfig {
|
||||
throw new Error('You need to specify a config() method your custom Tool.')
|
||||
return {
|
||||
title: 'ADD A <tool> TAG'
|
||||
} as unknown as ToolConfig
|
||||
};
|
||||
|
||||
public head() {
|
||||
const {title, description, keywords} = this.config()
|
||||
const {title, description, keywords} = this.$toolConfig
|
||||
|
||||
const uniqueKeywordsCleaned = [...new Set([...keywords, ...title.split(/\s+/)].map(s => s.trim().toLowerCase()))]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue