Setup basic routing

This commit is contained in:
Garrett Mills 2022-04-09 09:23:09 -05:00
parent 4450d63964
commit ecdb474f7e
4 changed files with 26 additions and 2 deletions

View File

@ -10,8 +10,10 @@ import { MathPage } from './support/page'
</script> </script>
<template> <template>
<img alt="Vue logo" src="./assets/logo.png" /> <div id="nav">
<Home msg="CrystalMathy" /> <router-link to="/">Home</router-link>
</div>
<router-view/>
</template> </template>
<style> <style>

View File

@ -2,6 +2,8 @@ import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import { DraggablePlugin } from '@braks/revue-draggable' import { DraggablePlugin } from '@braks/revue-draggable'
import { createAuth0 } from '@auth0/auth0-vue' import { createAuth0 } from '@auth0/auth0-vue'
import router from './router'
const app = createApp(App) const app = createApp(App)
@ -14,5 +16,7 @@ app.use(
}), }),
) )
app.use(router)
app.use(DraggablePlugin) app.use(DraggablePlugin)
app.mount('#app') app.mount('#app')

17
src/router.ts Normal file
View File

@ -0,0 +1,17 @@
import { createRouter, createWebHistory } from 'vue-router'
import Home from './components/Home.vue'
const routes = [
{
path: '/',
name: 'Home',
component: Home,
},
]
const router = createRouter({
history: createWebHistory(),
routes: routes,
})
export default router

View File

@ -85,6 +85,7 @@ export type LaTeXString = TypeTag<'@app.LaTeXString'> & string
export type HTMLString = TypeTag<'@app.HTMLString'> & string export type HTMLString = TypeTag<'@app.HTMLString'> & string
export type StatementID = TypeTag<'@app.StatementID'> & string export type StatementID = TypeTag<'@app.StatementID'> & string
export type VariableName = TypeTag<'@app.VariableName'> & string export type VariableName = TypeTag<'@app.VariableName'> & string
export type RoutePath = TypeTag<'@app.RoutePath'> & string
export interface EvaluationResult { export interface EvaluationResult {
variables: Record<VariableName, any> variables: Record<VariableName, any>