| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/bitnami/htdocs/app/node_modules/tiptap-vuetify/src/components/ |
Upload File : |
<template>
<!-- Open/Closed principle https://css-tricks.com/creating-vue-js-component-instances-programmatically/ -->
<div class="tiptap-vuetify-editor__toolbar">
<editor-menu-bar
v-slot="menuBarContext"
:editor="editor"
>
<!-- :buttons="buttons" -->
<slot
name="default"
:isActive="menuBarContext.isActive"
:commands="menuBarContext.commands"
>
<v-toolbar
v-bind="{
...toolbarConfig,
...toolbarAttributes
}"
>
<actions-render
:actions="actions"
:context="menuBarContext"
:editor="editor"
:disabled="disabled"
/>
</v-toolbar>
</slot>
</editor-menu-bar>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { Editor, EditorMenuBar } from 'tiptap'
import toolbarConfig from '~/configs/toolbar'
import ExtensionActionInterface from '~/extensions/actions/ExtensionActionInterface'
import ActionsRender from '~/components/ActionsRender.vue'
import { VToolbar } from 'vuetify/lib'
@Component({
components: {
ActionsRender,
EditorMenuBar,
VToolbar
}
})
export default class Toolbar extends Vue {
@Prop({ type: Boolean, default: false })
readonly disabled: boolean
@Prop({ type: Object, required: true })
readonly editor: Editor
@Prop({
type: Array,
default: () => []
})
readonly actions: ExtensionActionInterface[]
@Prop({
type: [Array, Object],
default: () => ({})
})
readonly toolbarAttributes!: any
readonly toolbarConfig = toolbarConfig
}
</script>
<style lang="stylus">
.tiptap-vuetify-editor__toolbar
.v-toolbar
display: flex
height: auto !important
padding: 5px
.v-toolbar__content
height: auto !important
flex-wrap: wrap
padding: 0
</style>