• "邮政编码"组件:<postcode> —— 快应用组件库H-UI


    获得焦点时的状态:

    空值时自动校验:

    不符合格式要求时自动校验:

    输入格式正确时:

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode1" params="{{params}}"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode2" params="{{params}}" form-horizontal="true"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode3" params="{{params}}" no-border="true" ></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode4" params="{{params}}" title="none"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode5" params="{{params}}" placeholder="none"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    用于设置个性化的输入提示语。

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode6" params="{{params}}" tip="格式如,518000"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode7" params="{{params}}" align-right="true"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode8" params="{{params}}" maxlength="6"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    


    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode9" params="{{params}}" valid="has-success"></postcode>
                <postcode id="postcode10" params="{{params}}" valid="has-warning"></postcode>
                <postcode id="postcode11" params="{{params}}" valid="has-error"></postcode>
                <postcode id="postcode9_2" params="{{params}}" valid="has-success" valid-icon="none"></postcode>
                <postcode id="postcode10_2" params="{{params}}" valid="has-warning" valid-icon="none"></postcode>
                <postcode id="postcode11_2" params="{{params}}" valid="has-error" valid-icon="none"></postcode>
                <postcode id="postcode12" params="{{params}}" valid="has-success" form-horizontal="true"></postcode>
                <postcode id="postcode13" params="{{params}}" valid="has-warning" form-horizontal="true"></postcode>
                <postcode id="postcode14" params="{{params}}" valid="has-error" form-horizontal="true"></postcode>
                <postcode id="postcode12_2" params="{{params}}" valid="has-success" form-horizontal="true" valid-icon="none"></postcode>
                <postcode id="postcode13_2" params="{{params}}" valid="has-warning" form-horizontal="true" valid-icon="none"></postcode>
                <postcode id="postcode14_2" params="{{params}}" valid="has-error" form-horizontal="true" valid-icon="none"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode15" params="{{params}}" valid="has-error" form-error="该邮政编码已存在!" value="518000"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode16" params="{{params}}" not-blank="false"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode17" params="{{params}}" value="518000" disabled="true"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode18" params="{{params}}" not-blank="false" valid="none" valid-icon="none"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        export default {
            private: {
                params: {}
            }
        }
    </script>
    

    <import name="form" src="../Common/ui/h-ui/form/c_form"></import>
    <import name="postcode" src="../Common/ui/h-ui/form/c_postcode"></import>
    <template>
        <div class="container">
            <form>
                <postcode id="postcode19" params="{{params}}"></postcode>
            </form>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        import prompt from '@system.prompt'
    
        export default {
            private: {
                params: {}
            },
            onInit() {
                this.$on('postcode19_dispatchEvt',this.dispatchEvt)
            },
            dispatchEvt(evt) {
                // 弹窗显示详细说明
                prompt.showToast({
                    message: evt.detail.value,
                    duration: 1,
                    gravity: 'top'
                })
            }
        }
    </script>
    

    扫码体验

  • 相关阅读:
    Spring的事务 之 9.4 声明式事务 ——跟我学spring3
    我对AOP的理解
    基于JDK动态代理和CGLIB动态代理的实现Spring注解管理事务(@Trasactional)到底有什么区别。
    我对IoC/DI的理解
    Spring对事务管理的支持的发展历程(基础篇)
    Tomcat一个BUG造成CLOSE_WAIT
    用dubbo时遇到的一个序列化的坑
    只写完功能代码仅仅只是开始
    事物隔离级别和乐观锁
    关于ubuntu实机与虚机互相copy
  • 原文地址:https://www.cnblogs.com/cloud-dev/p/you-zheng-bian-mazu-jianltpostcodegt--kuai-ying-yo.html
Copyright © 2020-2023  润新知