• "动作面板"组件:<action-sheet> —— 快应用组件库H-UI


    Screenshot_20200417_161857_com.huawei.fastapp

    <import name="action-sheet" src="../Common/ui/h-ui/feedback/c_action_sheet"></import>
    <import name="h-button" src="../Common/ui/h-ui/basic/c_button"></import>
    <template>
        <div class="container">
            <action-sheet id="actionsheet"></action-sheet>
            <h-button text="基本实例" block="true" type="info" onclick="handleClick1"></h-button>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        import prompt from '@system.prompt'
    
        export default {
            private: {
                data: [
                    {
                        icon: 'home',
                        title: '回到首页',
                        uri: '/Home'
                    },
                    {
                        title: 'Disabled',
                        disabled: 'true'
                    },
                    {
                        title: '删除',
                        color: 'red'
                    }
                ]
            },
            onInit() {
                this.$on('actionsheet_dispatchEvt',this.dispatchEvt)
            },
            dispatchEvt(evt) {
                // 弹窗显示详细说明
                prompt.showToast({
                    message: '第 ' + evt.detail.value + ' 个菜单被点击了!',
                    duration: 1,
                    gravity: 'top'
                })
            },
            handleClick1() {
                this.$child('actionsheet').showActionSheet({
                    id: 'actionsheet',
                    data: this.data
                });
            }
        }
    </script>
    

    Screenshot_20200417_161908_com.huawei.fastapp

    <import name="action-sheet" src="../Common/ui/h-ui/feedback/c_action_sheet"></import>
    <import name="h-button" src="../Common/ui/h-ui/basic/c_button"></import>
    <template>
        <div class="container">
            <action-sheet id="actionsheet"></action-sheet>
            <h-button text="设置自动消失时间" block="true" type="info" onclick="handleClick2"></h-button>
        </div>
    </template>
    
    <style lang="less">
        @import '../Common/styles/container.less';
    </style>
    
    <script>
        import prompt from '@system.prompt'
    
        export default {
            private: {
                data: [
                    {
                        icon: 'home',
                        title: '回到首页',
                        uri: '/Home'
                    },
                    {
                        title: 'Disabled',
                        disabled: 'true'
                    },
                    {
                        title: '删除',
                        color: 'red'
                    }
                ]
            },
            onInit() {
                this.$on('actionsheet_dispatchEvt',this.dispatchEvt)
            },
            dispatchEvt(evt) {
                // 弹窗显示详细说明
                prompt.showToast({
                    message: '第 ' + evt.detail.value + ' 个菜单被点击了!',
                    duration: 1,
                    gravity: 'top'
                })
            },
            handleClick2() {
                this.$child('actionsheet').showActionSheet({
                    id: 'actionsheet',
                    data: this.data,
                    duration: 5
                });
            }
        }
    </script>
    

    扫码体验

  • 相关阅读:
    A__Writeup_杂项 “百越杯”第四届福建省高校网络空间安全大赛——致我的战队HeroCat的所有成员
    A_由局域网到广域网的探索-------正在更新中ing
    B_由迷茫转向理性
    CTF__(1)web之Cookie
    网络安全常识介绍__(1)黑客获取密码的介绍
    AQS
    生产者-消费者模式
    synchronized修饰static方法与非static方法的区别
    Java内存溢出和内存泄露
    final、finally与finalize的区别
  • 原文地址:https://www.cnblogs.com/cloud-dev/p/dong-zuo-mian-banzu-jianltactionsheetgt--kuai-ying.html
Copyright © 2020-2023  润新知