feat: Create examples directory and add some examples
* Add svg plugins for vite & rollup update: more bundle stuff
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { routes } from './router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
const Header = defineComponent({
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const onChange = async (event: any) => {
|
||||
await router.push(event.target.value);
|
||||
};
|
||||
|
||||
return () => (
|
||||
<header>
|
||||
<a class="logo" href="https://github.com/wbkd/react-flow">
|
||||
Revue Flow Dev
|
||||
</a>
|
||||
<select v-model={route.path} onChange={onChange}>
|
||||
{routes.map((route) => (
|
||||
<option value={route.path} key={route.path}>
|
||||
{route.path === '/' ? 'overview' : route.path.substr(1, route.path.length)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export default Header;
|
||||
Reference in New Issue
Block a user