-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88f9a14
commit 1af9ad5
Showing
13 changed files
with
325 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@watermark-design/vue': minor | ||
--- | ||
|
||
add blind watermark component in vue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import blind from './src/blind.vue'; | ||
|
||
export default blind; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<Teleport to="body" :disabled="!appendToBody" :key="key" v-if="key"> | ||
<div :style="watermarkWrapperStyle" ref="watermarkWrapperRef"> | ||
<slot name="default"></slot> | ||
<div :style="watermarkStyle" v-if="modelValue"></div> | ||
</div> | ||
</Teleport> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, isVue2 } from 'vue-demi'; | ||
import Teleport from '../../teleport'; | ||
import watermarkMixin, { WatermarkMixinType } from '../../mixins/watermark.mixin'; | ||
export default defineComponent({ | ||
name: 'BlindWatermark', | ||
directives: {}, | ||
mixins: [watermarkMixin as WatermarkMixinType], | ||
...(isVue2 | ||
? { | ||
components: { | ||
Teleport, | ||
}, | ||
model: { | ||
prop: 'modelValue', | ||
event: 'modelChange', | ||
}, | ||
} | ||
: null), | ||
props: { | ||
globalAlpha: { | ||
type: Number, | ||
default: 0.005, | ||
}, | ||
mode: { | ||
type: String, | ||
default: 'blind', | ||
}, | ||
modelValue: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
}, | ||
emits: [isVue2 ? 'modelChange' : 'update:modelValue'], | ||
data() { | ||
return {}; | ||
}, | ||
computed: {}, | ||
watch: { | ||
modelValue(value) { | ||
if (value) { | ||
this.handleObserver(); | ||
} else { | ||
this.removeObserver(); | ||
} | ||
}, | ||
}, | ||
created() {}, | ||
mounted() {}, | ||
methods: {}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.