|
|
@ -1,15 +1,3 @@ |
|
|
|
<script setup> |
|
|
|
import { provide } from 'vue' |
|
|
|
import {useRouter, useRoute} from 'vue-router' |
|
|
|
|
|
|
|
provide("router", useRouter()) |
|
|
|
provide("route", useRoute()) |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<router-view /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style> |
|
|
|
#app { |
|
|
|
font-family: Avenir, Helvetica, Arial, sans-serif; |
|
|
@ -20,3 +8,23 @@ |
|
|
|
height:100%; |
|
|
|
} |
|
|
|
</style> |
|
|
|
<template> |
|
|
|
<router-view /> |
|
|
|
</template> |
|
|
|
<script setup> |
|
|
|
import { inject, provide } from 'vue' |
|
|
|
import {useRouter, useRoute} from 'vue-router' |
|
|
|
|
|
|
|
provide("router", useRouter()) |
|
|
|
provide("route", useRoute()) |
|
|
|
|
|
|
|
var event=inject("event") |
|
|
|
window._e=event |
|
|
|
function eventDemo(){ |
|
|
|
setTimeout(()=>{ |
|
|
|
event.emit("home",323) |
|
|
|
eventDemo() |
|
|
|
},5000) |
|
|
|
} |
|
|
|
eventDemo() |
|
|
|
</script> |