首页 > 其他 > 详细

solt插槽的使用。

时间:2018-06-08 20:22:25      阅读:170      评论:0      收藏:0      [点我收藏+]
在组件内template中使用 <slot name=header></slot>
在页面内 直接添加标签 如 <hs><h1 slot=header></h1></hs> 用来匹配这些元素。
<slot></slot> 帮助在组件内进行 占位 具有name属性 用来进行区别他们的位置。

this.$router.push({name:home,params:{id:5555}});编码式路由

router 可以有name属性用来起名

router具有path 属性 components属性 必须填写的两个属性。

let router = new VueRouter({
    mode:hash//带#号  ‘history‘ //类似于后端接口
    LinkActiveClass:class名//动态切换, 默认router-link-active 就自带动态切换。
    routers:[
       {
        path:/home;
        name:Home,
        components:{
           template:‘‘
         }
        },
       {},
       {}
       ]
});

 

solt插槽的使用。

原文:https://www.cnblogs.com/l8l8/p/9157328.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!