2022-04-09 14:34:29 +00:00
|
|
|
<script setup lang="ts">
|
2022-04-09 15:34:33 +00:00
|
|
|
import {MathPage} from '../support/page'
|
|
|
|
import {v4 as uuidv4} from 'uuid'
|
|
|
|
import Statement from './Statement.vue'
|
2022-04-09 15:56:54 +00:00
|
|
|
import {MathStatement} from '../support/parse'
|
2022-04-09 14:34:29 +00:00
|
|
|
|
2022-04-09 15:34:33 +00:00
|
|
|
const page = new MathPage(uuidv4())
|
|
|
|
const stmt1Id = page.addRaw('x = y+3/4')
|
|
|
|
const stmt2Id = page.addRaw('y = 9')
|
|
|
|
const evaluation = page.evaluate()
|
2022-04-09 15:56:54 +00:00
|
|
|
|
|
|
|
const stmt = page.getStatement(stmt1Id)
|
2022-04-09 15:34:33 +00:00
|
|
|
console.log({page, stmt1Id})
|
2022-04-09 15:56:54 +00:00
|
|
|
|
|
|
|
const onEdit = (stmt: MathStatement) => () => console.log('edit', stmt)
|
2022-04-09 14:34:29 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<p>Scratch page for testing!</p>
|
2022-04-09 15:56:54 +00:00
|
|
|
<Statement v-if="stmt" :statement="stmt" :evaluation="evaluation"/>
|
2022-04-09 14:34:29 +00:00
|
|
|
</template>
|