zoukankan      html  css  js  c++  java
  • 组件:组合slot

    <!DOCTYPE html>
    <html lang="zh">
    
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="https://unpkg.com/vue/dist/vue.js"></script>
        <link href="../css/style.css" rel="stylesheet"> </head>
    <body>
    <div id="myApp">
        <nba-all-stars c="奥尼尔" pf="加内特">
            <span slot="sf">皮尔斯</span>
            <span slot="sg">雷阿伦</span>
            <span slot="pg">隆多</span>
        </nba-all-stars>
    </div>
    <script>
        Vue.component('nba-all-stars', {
            props: ['c', 'pf'],
            template: '<div>'
                + '<div>中锋:{{c}}</div>'
                + '<div>大前:{{pf}}</div>'
                + '<div>小前:<slot name="sf"></slot></div>'
                + '<div>分卫:<slot name="sg"></slot></div>'
                + '<div>控卫:<slot name="pg"></slot></div>'
                + '</div>',
        });
        var myApp = new Vue({
            el: '#myApp',
        });
    </script>
    </body>
    
    </html>
  • 相关阅读:
    2011 ACM-ICPC 成都赛区解题报告(转)
    Subarray Sorting (线段树)
    sample
    gamma correction / /alpha blend
    mipmap
    antialiasing
    汇编指令
    zfighting 的问题
    勉励自己
    Ambient Occulution
  • 原文地址:https://www.cnblogs.com/Jeely/p/11057503.html
Copyright © 2011-2022 走看看