You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
894 B
31 lines
894 B
import { VueConstructor } from 'vue'
|
|
import { VxeUI } from '@vxe-ui/core'
|
|
import VxeWatermarkComponent from './src/watermark'
|
|
import { checkDynamic, dynamicStore, dynamicApp } from '../dynamics'
|
|
|
|
import type { VxeWatermarkProps } from '../../types'
|
|
|
|
export const VxeWatermark = Object.assign({}, VxeWatermarkComponent, {
|
|
install (app: VueConstructor) {
|
|
app.component(VxeWatermarkComponent.name as string, VxeWatermarkComponent)
|
|
}
|
|
})
|
|
|
|
dynamicApp.use(VxeWatermark)
|
|
VxeUI.component(VxeWatermarkComponent)
|
|
|
|
export const WatermarkController = {
|
|
load (options: VxeWatermarkProps) {
|
|
checkDynamic()
|
|
dynamicStore.globalWatermark = Object.assign({}, options)
|
|
return Promise.resolve()
|
|
},
|
|
clear () {
|
|
dynamicStore.globalWatermark = null
|
|
return Promise.resolve()
|
|
}
|
|
}
|
|
VxeUI.watermark = WatermarkController
|
|
|
|
export const Watermark = VxeWatermark
|
|
export default VxeWatermark
|
|
|