mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
chore(vue3): migrate custom component registration
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
7b5ff7795e
commit
2437bc9415
1 changed files with 4 additions and 8 deletions
12
src/flow.js
12
src/flow.js
|
|
@ -3,19 +3,15 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import wrap from '@vue/web-component-wrapper'
|
||||
import Vue from 'vue'
|
||||
import { defineCustomElement } from 'vue'
|
||||
import FlowPostToConversation from './views/FlowPostToConversation.vue'
|
||||
|
||||
const FlowPostToConversationComponent = wrap(Vue, FlowPostToConversation)
|
||||
const FlowPostToConversationComponent = defineCustomElement(FlowPostToConversation, {
|
||||
shadowRoot: false,
|
||||
})
|
||||
const customElementId = 'oca-spreed-flow_post_to_conversation'
|
||||
window.customElements.define(customElementId, FlowPostToConversationComponent)
|
||||
|
||||
// In Vue 2, wrap doesn't support disabling shadow :(
|
||||
// Disable with a hack
|
||||
Object.defineProperty(FlowPostToConversationComponent.prototype, 'attachShadow', { value() { return this } })
|
||||
Object.defineProperty(FlowPostToConversationComponent.prototype, 'shadowRoot', { get() { return this } })
|
||||
|
||||
window.OCA.WorkflowEngine.registerOperator({
|
||||
id: 'OCA\\Talk\\Flow\\Operation',
|
||||
color: '#0082c9',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue