docs: add transition example

This commit is contained in:
braks
2022-10-07 23:49:03 +02:00
parent 40d59d9d84
commit 447699cb05
11 changed files with 265 additions and 7 deletions
@@ -1,6 +1,6 @@
<script setup>
import { Handle, Position } from '@braks/vue-flow'
import { useTransition } from './useTransition.js'
import { useTeleport } from './useTransition.js'
const props = defineProps({
id: {
@@ -9,7 +9,7 @@ const props = defineProps({
},
})
const { animation, transition, teleport, onClick } = useTransition(props.id)
const { animation, transition, teleport, onClick } = useTeleport(props.id)
const changeAnimation = () => {
animation.value = animation.value === 'fade' ? 'shrink' : 'fade'
+1 -1
View File
@@ -1,5 +1,5 @@
export { default as TeleportApp } from './App.vue?raw'
export { default as TeleportSidebar } from './Sidebar.vue?raw'
export { default as TeleportableNode } from './TeleportableNode.vue?raw'
export { default as TeleportableUseTransition } from './useTransition.js?raw'
export { default as TeleportableUseTransition } from './useTeleport.js?raw'
export { default as TeleportCSS } from './style.css'
@@ -7,7 +7,7 @@ import { nextTick, ref } from 'vue'
* Animations that resize a node need to call the `updateNodeDimensions` function from store to update node handle positions
* Otherwise edges do not connect properly
*/
export const useTransition = (id) => {
export const useTeleport = (id) => {
const animation = ref('fade')
const transition = ref(false)
const teleport = ref(null)