chore(docs): cleanup intro
This commit is contained in:
@@ -56,7 +56,7 @@ const initialEdges = [
|
|||||||
style: { strokeWidth: 4, stroke: '#0ea5e9' },
|
style: { strokeWidth: 4, stroke: '#0ea5e9' },
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const { getNodes, findNode, setEdges, updateNodeInternals, dimensions, onNodesInitialized } = useVueFlow({
|
const { getNodes, findNode, setEdges, updateNodeInternals, dimensions, onPaneReady } = useVueFlow({
|
||||||
nodes: [
|
nodes: [
|
||||||
{ id: 'intro', type: 'box', position: { x: 0, y: 0 } },
|
{ id: 'intro', type: 'box', position: { x: 0, y: 0 } },
|
||||||
{ id: 'examples', type: 'box', position: { x: -50, y: 400 } },
|
{ id: 'examples', type: 'box', position: { x: -50, y: 400 } },
|
||||||
@@ -75,8 +75,7 @@ const { getNodes, findNode, setEdges, updateNodeInternals, dimensions, onNodesIn
|
|||||||
|
|
||||||
const el = templateRef<HTMLDivElement>('el', null)
|
const el = templateRef<HTMLDivElement>('el', null)
|
||||||
|
|
||||||
const setElements = useDebounceFn(
|
const setElements = useDebounceFn(() => {
|
||||||
() => {
|
|
||||||
const offsetX = dimensions.value.width / 2
|
const offsetX = dimensions.value.width / 2
|
||||||
const offsetY = dimensions.value.height / 4
|
const offsetY = dimensions.value.height / 4
|
||||||
|
|
||||||
@@ -176,15 +175,11 @@ const setElements = useDebounceFn(
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
updateNodeInternals()
|
updateNodeInternals()
|
||||||
})
|
})
|
||||||
},
|
}, 1)
|
||||||
() => (currentBreakpoint.value === null ? 5 : 50),
|
|
||||||
)
|
|
||||||
|
|
||||||
onNodesInitialized(() => {
|
|
||||||
setElements()
|
|
||||||
})
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
useResizeObserver(el, setElements)
|
useResizeObserver(el, setElements)
|
||||||
|
})
|
||||||
|
|
||||||
function scrollTo() {
|
function scrollTo() {
|
||||||
const el = document.getElementById('acknowledgement')
|
const el = document.getElementById('acknowledgement')
|
||||||
|
|||||||
Reference in New Issue
Block a user