• "多选框"组件:<checkbox> —— 快应用组件库H-UI


    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox1" params="{{params}}" title="广告投放地区" data="{{data}}"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox2" params="{{params}}" title="广告投放地区" data="{{data}}" value="{{values}}"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ],
                values: ["option2", "option4"]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox3" params="{{params}}" title="广告投放地区" data="{{data}}" not-blank="false"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox4" params="{{params}}" title="广告投放地区" data="{{data}}"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3", disabled: true},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox5" params="{{params}}" title="广告投放地区" data="{{data}}" valid="has-error" form-error="非法值!"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox6" params="{{params}}" title="广告投放地区" data="{{data}}" valid="none" not-blank="false"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox7" params="{{params}}" title="广告投放地区" data="{{data}}" collapse="true"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox8" params="{{params}}" title="广告投放地区" data="{{data}}" icon="bullhorn"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="checkbox" src="../Common/ui/h-ui/form/c_checkbox"></import>
    <template>
        <div class="container">
            <form>
                <checkbox id="checkbox9" params="{{params}}" title="广告投放地区" data="{{data}}"></checkbox>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        import prompt from '@system.prompt'
    
        export default {
            private: {
                params: {},
                data: [
                    {label: "北京", value: "option1"},
                    {label: "上海", value: "option2"},
                    {label: "广州", value: "option3"},
                    {label: "深圳", value: "option4"}
                ]
            },
            onInit() {
                this.$on('checkbox9_dispatchEvt',this.dispatchEvt)
            },
            dispatchEvt(evt) {
                // 弹窗显示详细说明
                prompt.showToast({
                    message: evt.detail.value,
                    duration: 1,
                    gravity: 'top'
                })
            }
        }
    </script>
    

    扫码体验

  • 相关阅读:
    成为Java GC专家系列(3) — 如何优化Java垃圾回收机制
    成为JavaGC专家Part II — 如何监控Java垃圾回收机制
    JAVA缓存的实现
    Lock Less Java Object Pool
    跟屌丝大哥学习设计模式--享元模式
    数据库 -- 由数据库连接池引出的三种设计模式
    优秀博客推荐:各种数据结构与算法知识入门经典
    学习总结
    洛谷P3360偷天换日(树形DP)
    疯子的算法总结14--ST算法(区间最值)
  • 原文地址:https://www.cnblogs.com/cloud-dev/p/duo-xuan-kuangzu-jianltcheckboxgt--kuai-ying-yong-.html
Copyright © 2020-2023  润新知