Open adodo0829 opened 4 years ago
<div @[event]="handler">
## 路由 router
```html
<!-- 添加了作用域插槽,可以根据回传的状态自定义一些效果 -->
<router-link to="/" custom v-slot="{ href, navigate, isActive }">
<li :class="{ 'active': isActive }">
<a :href="href" @click="navigate">
<Icon>home</Icon><span class="xs-hidden">Home</span>
</a>
</li>
</router-link>
<!-- meta对象合并 -->
<!-- 添加了几个 router 实例的 api -->
<!-- router.addRoute(route: RouteRecord) 动态添加路由
router.removeRoute(name: string | symbol),动态删除路由
router.hasRoute(name: string | symbol): boolean ,判断路由是否存在
router.getRoutes(): RouteRecord[] 获取路由列表 -->
不再限制只是一个了
vue3.0 新语法预览
关于一些 vue3.0 的新语法, 期待正式版本的到来...
地址1: https://github.com/vuejs/rfcs/tree/master/active-rfcs 地址2: https://vue-composition-api-rfc.netlify.app/zh/#api-%E4%BB%8B%E7%BB%8D
global API
composition API
组件内是用组合式 API 调用, 解决组件内部的 this 依赖, 更好的组件代码组织方式, 按函数执行逻辑的方式以及ts支持
Tree-shaking支持
只打包用到的组件模块
teleport 组件
解决 z-index 等问题
异步组件: 通过方法定义
函数组件
一些功能指令
<div :[key]="value">
<div v-on:[event]="handler">