docs: add transition example
This commit is contained in:
@@ -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,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'
|
||||
|
||||
+1
-1
@@ -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)
|
||||
Reference in New Issue
Block a user