Plugin system (#6479)

* wip

* wip

* wip

* wip

* Update store.ts
This commit is contained in:
syuilo 2020-07-12 00:38:55 +09:00 committed by GitHub
parent debc0086fa
commit 9b73e897df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 293 additions and 17 deletions

View file

@ -4,7 +4,7 @@
<script lang="ts">
import Vue from 'vue';
import { faAt, faListUl, faEye, faEyeSlash, faBan, faPencilAlt, faComments, faUsers, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons';
import { faAt, faListUl, faEye, faEyeSlash, faBan, faPencilAlt, faComments, faUsers, faMicrophoneSlash, faPlug } from '@fortawesome/free-solid-svg-icons';
import { faSnowflake, faEnvelope } from '@fortawesome/free-regular-svg-icons';
import XMenu from './menu.vue';
import copyToClipboard from '../scripts/copy-to-clipboard';
@ -80,6 +80,16 @@ export default Vue.extend({
}]);
}
if (this.$store.state.userActions.length > 0) {
menu = menu.concat([null, ...this.$store.state.userActions.map(action => ({
icon: faPlug,
text: action.title,
action: () => {
action.handler(this.user);
}
}))]);
}
return {
items: menu
};