page: 📄 自定义拖拽框
This commit is contained in:
parent
73a74e3569
commit
3346703796
138
README.md
138
README.md
|
@ -1,80 +1,62 @@
|
|||
```sh
|
||||
Simple Drag Bounds
|
||||
Complex Drag and Drop
|
||||
Drop Events
|
||||
SELECT AND TRANSFORM
|
||||
Basic demo
|
||||
Centered Scaling
|
||||
Keep Ratio
|
||||
Styling
|
||||
Complex Styling
|
||||
Transform Events
|
||||
Resize Limits
|
||||
Rotation Snaps
|
||||
Resize Snaps
|
||||
Stop Transform
|
||||
Force Update
|
||||
Text Resizing
|
||||
Ignore Stroke
|
||||
CLIPPING
|
||||
Simple Clip
|
||||
Complex Clip
|
||||
GROUPS, LAYERS AND ORDERING
|
||||
Groups
|
||||
Layering
|
||||
Change Containers
|
||||
zIndex
|
||||
FILTERS
|
||||
Blur
|
||||
Brighten
|
||||
Contrast
|
||||
Emboss
|
||||
Enhance
|
||||
Grayscale
|
||||
HSL
|
||||
HSV
|
||||
RGB
|
||||
Invert
|
||||
Kaleidoscope
|
||||
Mask
|
||||
Noise
|
||||
Pixelate
|
||||
Custom Filter
|
||||
Multiple Filters
|
||||
TWEENS
|
||||
Linear Easing
|
||||
Common Easings
|
||||
All Easings
|
||||
Finish Event
|
||||
All Controls
|
||||
Tween Filter
|
||||
Complex Tweening
|
||||
ANIMATIONS
|
||||
Create an Animation
|
||||
Moving
|
||||
Rotation
|
||||
Scaling
|
||||
Stop Animation
|
||||
SELECTORS
|
||||
Select by id
|
||||
Select by Type
|
||||
Select by Name
|
||||
DATA & SERIALIZATION & EXPORT
|
||||
Serialize a Stage
|
||||
Simple Load
|
||||
Complex Load
|
||||
JSON Best Practices
|
||||
Stage Data URL
|
||||
Export to HD Image
|
||||
PERFORMANCE
|
||||
All tips
|
||||
Layer Management
|
||||
Batch Draw
|
||||
Shape Caching
|
||||
Optimize Animation
|
||||
Optimize Strokes
|
||||
Shape Redraw
|
||||
Disable Perfect Drawing
|
||||
Listening False
|
||||
Avoid Memory Leaks
|
||||
styling
|
||||
complex styling
|
||||
transform events
|
||||
resize limits
|
||||
rotation snaps
|
||||
resize snaps
|
||||
stop transform
|
||||
force update
|
||||
text resizing
|
||||
ignore stroke
|
||||
clipping
|
||||
simple clip
|
||||
complex clip
|
||||
groups, layers and ordering
|
||||
groups
|
||||
layering
|
||||
change containers
|
||||
zindex
|
||||
filters
|
||||
blur
|
||||
brighten
|
||||
contrast
|
||||
emboss
|
||||
enhance
|
||||
grayscale
|
||||
hsl
|
||||
hsv
|
||||
rgb
|
||||
invert
|
||||
kaleidoscope
|
||||
mask
|
||||
noise
|
||||
pixelate
|
||||
custom filter
|
||||
multiple filters
|
||||
tweens
|
||||
linear easing
|
||||
common easings
|
||||
all easings
|
||||
finish event
|
||||
all controls
|
||||
tween filter
|
||||
complex tweening
|
||||
animations
|
||||
create an animation
|
||||
moving
|
||||
rotation
|
||||
scaling
|
||||
stop animation
|
||||
selectors
|
||||
select by id
|
||||
select by type
|
||||
select by name
|
||||
data & serialization & export
|
||||
serialize a stage
|
||||
simple load
|
||||
complex load
|
||||
json best practices
|
||||
stage data url
|
||||
export to hd image
|
||||
```
|
|
@ -0,0 +1,43 @@
|
|||
<script setup lang="ts">
|
||||
import { useWindowSize } from '@vueuse/core';
|
||||
import { onMounted } from 'vue';
|
||||
import Konva from 'konva/lib';
|
||||
|
||||
const { width, height } = useWindowSize();
|
||||
|
||||
const initial = () => {
|
||||
const stage = new Konva.Stage({ container: 'container', width: width.value, height: height.value });
|
||||
const layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
const circle = new Konva.Circle({
|
||||
x: 150,
|
||||
y: 150,
|
||||
radius: 70,
|
||||
fill: 'red',
|
||||
draggable: true,
|
||||
});
|
||||
layer.add(circle);
|
||||
|
||||
const tr = new Konva.Transformer({
|
||||
anchorStroke: 'black',
|
||||
anchorStrokeWidth: 10,
|
||||
anchorFill: 'blue',
|
||||
anchorSize: 40,
|
||||
borderDash: [6, 6],
|
||||
borderStroke: 'green',
|
||||
nodes: [circle],
|
||||
});
|
||||
layer.add(tr);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
initial();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="container"></div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss"></style>
|
Loading…
Reference in New Issue