• 弹出菜单--模态框


    index.wxml

    <!--index.wxml-->
    <view class="container">
      <button type="primary" bindtap="btnToDo">click me....</button>
    </view>
    

      index.js

    //index.js
    Page({
      data: {
    
      },
    
      btnToDo: function () {
        // 当点击按钮触发
        // console.log(1111)
        // 交互操作组件 必须通过调用API方式使用
        // wx.showActionSheet({
        //   // 显示出来的项目列表
        //   itemList: ['传智播客', '黑马程序员', '博学谷在线', '酷丁鱼'],
        //   // 点击其中任一项的回调
        //   success: function (res) {
        //     // res.cancel 指的是是否点击了取消
        //     if (!res.cancel) {
        //       // tapIndex指的是点击的下标
        //       console.log(res.tapIndex)
        //     }
        //   }
        // })
    
        // wx.showModal({
        //   title: '提示',
        //   content: '这是一个模态弹窗',
        //   success: function(res) {
        //     if (res.confirm) {
        //       console.log('用户点击确定')
        //     }
        //   }
        // })
    
        // wx.showToast({
        //   title: '成功',
        //   // 只支持 success 和 loading
        //   icon: 'loading',
        //   duration: 2000
        // })
      }
    })
  • 相关阅读:
    css相关
    杂题
    vuesheng生命周期
    box-sizing
    js正则学习
    浏览器加载解析过程
    Sass学习笔记
    jQuery与原生js实现banner轮播图
    jq-animate实现返回顶部效果
    jq-animate
  • 原文地址:https://www.cnblogs.com/fdxjava/p/11559774.html
Copyright © 2020-2023  润新知