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


    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio1" params="{{params}}" title="广告投放地区" data="{{data}}"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio2" params="{{params}}" title="广告投放地区" data="{{data}}" value="option2"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio3" params="{{params}}" title="广告投放地区" data="{{data}}" not-blank="false"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio4" params="{{params}}" title="广告投放地区" data="{{data}}"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio5" params="{{params}}" title="广告投放地区" data="{{data}}" valid="has-error" form-error="非法值!"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio6" params="{{params}}" title="广告投放地区" data="{{data}}" valid="none" not-blank="false"s></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio7" params="{{params}}" title="广告投放地区" data="{{data}}" collapse="true"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio8" params="{{params}}" title="广告投放地区" data="{{data}}" icon="bullhorn"></radio>
            </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="radio" src="../Common/ui/h-ui/form/c_radio"></import>
    <template>
        <div class="container">
            <form>
                <radio id="radio9" params="{{params}}" title="广告投放地区" data="{{data}}"></radio>
            </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('radio9_dispatchEvt',this.dispatchEvt)
            },
            dispatchEvt(evt) {
                // 弹窗显示详细说明
                prompt.showToast({
                    message: evt.detail.value,
                    duration: 1,
                    gravity: 'top'
                })
            }
        }
    </script>
    

    扫码体验

  • 相关阅读:
    学习《Beginning iPhone 4 Development 》第6章关于View Switcher这个例子的问题
    Task、Thread、Process、Program
    Xcode Build版本号自增
    NSAutoreleasePool
    xml文件操作
    一些收集整理的JS
    网页常用小技巧
    40种网站设计常用技巧
    在虚拟主机中用ASP.NET1.1服务器端TIMER定时读取RSS信息到数据库
    删除服务器的文件夹后,session就丢失的问题
  • 原文地址:https://www.cnblogs.com/cloud-dev/p/dan-xuan-kuangzu-jianltradiogt--kuai-ying-yong-zu-.html
Copyright © 2020-2023  润新知