zoukankan      html  css  js  c++  java
  • "宫格导航"组件:<grid> —— 快应用组件库H-UI

    <import name="grid" src="../Common/ui/h-ui/navigation/c_grid"></import>
    <template>
        <div class="container">
            <grid data="{{data}}"></grid>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                data:[
                    {
                        icon: 'female',
                        bgColor: 'bg-success',
                        text: '美妆'
                    },
                    {
                        icon: 'bag',
                        bgColor: 'bg-danger',
                        text: '包包'
                    },
                    {
                        icon: 'ring',
                        bgColor: 'bg-indigo',
                        text: '戒指'
                    },
                    {
                        icon: 'necklace',
                        bgColor: 'bg-pink',
                        text: '项链'
                    },
                    {
                        icon: 'skirt',
                        bgColor: 'bg-orange',
                        text: '连衣裙'
                    },
                    {
                        icon: 'shoe',
                        bgColor: 'bg-teal',
                        text: '高跟鞋'
                    },
                    {
                        icon: 't-shirt',
                        bgColor: 'bg-purple',
                        text: 'T恤'
                    },
                    {
                        icon: 'pants',
                        bgColor: 'bg-cyan',
                        text: '裤子'
                    },
                    {
                        icon: 'coat',
                        bgColor: 'bg-warning',
                        text: '外套'
                    }
                ]
            }
        }
    </script>
    

    <import name="grid" src="../Common/ui/h-ui/navigation/c_grid"></import>
    <template>
        <div class="container">
            <grid data="{{data}}" mode="rect"></grid>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                data:[
                    {
                        icon: 'female',
                        bgColor: 'bg-success',
                        text: '美妆'
                    },
                    {
                        icon: 'bag',
                        bgColor: 'bg-danger',
                        text: '包包'
                    },
                    {
                        icon: 'ring',
                        bgColor: 'bg-indigo',
                        text: '戒指'
                    },
                    {
                        icon: 'necklace',
                        bgColor: 'bg-pink',
                        text: '项链'
                    },
                    {
                        icon: 'skirt',
                        bgColor: 'bg-orange',
                        text: '连衣裙'
                    },
                    {
                        icon: 'shoe',
                        bgColor: 'bg-teal',
                        text: '高跟鞋'
                    },
                    {
                        icon: 't-shirt',
                        bgColor: 'bg-purple',
                        text: 'T恤'
                    },
                    {
                        icon: 'pants',
                        bgColor: 'bg-cyan',
                        text: '裤子'
                    },
                    {
                        icon: 'coat',
                        bgColor: 'bg-warning',
                        text: '外套'
                    }
                ]
            }
        }
    </script>
    

    <import name="grid" src="../Common/ui/h-ui/navigation/c_grid"></import>
    <template>
        <div class="container">
            <grid data="{{data}}" column-num="4"></grid>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                data:[
                    {
                        icon: 'female',
                        bgColor: 'bg-success',
                        text: '美妆'
                    },
                    {
                        icon: 'bag',
                        bgColor: 'bg-danger',
                        text: '包包'
                    },
                    {
                        icon: 'ring',
                        bgColor: 'bg-indigo',
                        text: '戒指'
                    },
                    {
                        icon: 'necklace',
                        bgColor: 'bg-pink',
                        text: '项链'
                    },
                    {
                        icon: 'skirt',
                        bgColor: 'bg-orange',
                        text: '连衣裙'
                    },
                    {
                        icon: 'shoe',
                        bgColor: 'bg-teal',
                        text: '高跟鞋'
                    },
                    {
                        icon: 't-shirt',
                        bgColor: 'bg-purple',
                        text: 'T恤'
                    },
                    {
                        icon: 'pants',
                        bgColor: 'bg-cyan',
                        text: '裤子'
                    },
                    {
                        icon: 'coat',
                        bgColor: 'bg-warning',
                        text: '外套'
                    }
                ]
            }
        }
    </script>
    

    <import name="grid" src="../Common/ui/h-ui/navigation/c_grid"></import>
    <template>
        <div class="container">
            <grid data="{{data}}" no-border="true"></grid>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                data:[
                    {
                        icon: 'female',
                        bgColor: 'bg-success',
                        text: '美妆'
                    },
                    {
                        icon: 'bag',
                        bgColor: 'bg-danger',
                        text: '包包'
                    },
                    {
                        icon: 'ring',
                        bgColor: 'bg-indigo',
                        text: '戒指'
                    },
                    {
                        icon: 'necklace',
                        bgColor: 'bg-pink',
                        text: '项链'
                    },
                    {
                        icon: 'skirt',
                        bgColor: 'bg-orange',
                        text: '连衣裙'
                    },
                    {
                        icon: 'shoe',
                        bgColor: 'bg-teal',
                        text: '高跟鞋'
                    },
                    {
                        icon: 't-shirt',
                        bgColor: 'bg-purple',
                        text: 'T恤'
                    },
                    {
                        icon: 'pants',
                        bgColor: 'bg-cyan',
                        text: '裤子'
                    },
                    {
                        icon: 'coat',
                        bgColor: 'bg-warning',
                        text: '外套'
                    }
                ]
            }
        }
    </script>
    

    <import name="grid" src="../Common/ui/h-ui/navigation/c_grid"></import>
    <template>
        <div class="container">
            <grid data="{{data}}"></grid>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                data:[
                    {
                        image: '/Common/icons/logo.png',
                        text: '快应用',
                    },
                    {
                        icon: 'bag',
                        bgColor: 'bg-danger',
                        text: '包包'
                    },
                    {
                        icon: 'ring',
                        bgColor: 'bg-indigo',
                        text: '戒指'
                    },
                    {
                        icon: 'necklace',
                        bgColor: 'bg-pink',
                        text: '项链'
                    },
                    {
                        icon: 'skirt',
                        bgColor: 'bg-orange',
                        text: '连衣裙'
                    },
                    {
                        icon: 'shoe',
                        bgColor: 'bg-teal',
                        text: '高跟鞋'
                    },
                    {
                        icon: 't-shirt',
                        bgColor: 'bg-purple',
                        text: 'T恤'
                    },
                    {
                        icon: 'pants',
                        bgColor: 'bg-cyan',
                        text: '裤子'
                    },
                    {
                        icon: 'coat',
                        bgColor: 'bg-warning',
                        text: '外套'
                    }
                ]
            }
        }
    </script>
    

    点击“导航”,页面转向:

    <import name="grid" src="../Common/ui/h-ui/navigation/c_grid"></import>
    <template>
        <div class="container">
            <grid data="{{data}}"></grid>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                data:[
                    {
                        image: '/Common/icons/logo.png',
                        text: '导航',
                        uri: 'About'
                    },
                    {
                        icon: 'bag',
                        bgColor: 'bg-danger',
                        text: '包包',
                        uri: 'About'
                    },
                    {
                        icon: 'ring',
                        bgColor: 'bg-indigo',
                        text: '戒指'
                    },
                    {
                        icon: 'necklace',
                        bgColor: 'bg-pink',
                        text: '项链'
                    },
                    {
                        icon: 'skirt',
                        bgColor: 'bg-orange',
                        text: '连衣裙'
                    },
                    {
                        icon: 'shoe',
                        bgColor: 'bg-teal',
                        text: '高跟鞋'
                    },
                    {
                        icon: 't-shirt',
                        bgColor: 'bg-purple',
                        text: 'T恤'
                    },
                    {
                        icon: 'pants',
                        bgColor: 'bg-cyan',
                        text: '裤子'
                    },
                    {
                        icon: 'coat',
                        bgColor: 'bg-warning',
                        text: '外套'
                    }
                ]
            }
        }
    </script>
    

    扫码体验

  • 相关阅读:
    21个高质量的Swift开源iOS App
    浅谈 JavaScriptCore
    开发完 iOS 应用,接下去你该做的事
    Xcode8的调试技能Memory Graph 实战解决闭包引用循环问题
    减肥App计划
    在管理实际中,心态很重要,当你以欣赏的态度去看一件事,你便会看到许多优点,以批评的态度,你便会看到无数缺点。
    怎样做才是一个独立自主的人?
    《圣经、》箴言篇13.3
    做事情需要坚持需要毅力更加需要观察和方法。(人生会遭遇许多事,其中很多是难以解决的,这时心中被盘根错结的烦恼纠缠住,茫茫然不知如何面对?如果能静下心來思考,往往会恍然大悟。 )
    10000单词积累,从今天开始(待续)。。。
  • 原文地址:https://www.cnblogs.com/cloud-dev/p/gong-ge-dao-hangzu-jianltgridgt--kuai-ying-yong-zu.html
Copyright © 2011-2022 走看看