zoukankan      html  css  js  c++  java
  • 小程序开发问题

    数据内容换行:

    1. 必须在text标签内
    2. 
    换行,
    Enter, 	空格

     导航页面跳转传参:

    方法:通过Page中的onLoad自动接收参数
    <view class="btn-area"> <navigator url="/page/navigate/navigate?title=navigate" hover-class="navigator-hover">跳转到新页面</navigator> <navigator url="../../redirect/redirect/redirect?title=redirect" open-type="redirect" hover-class="other-navigator-hover">在当前页打开</navigator> <navigator url="/page/index/index" open-type="switchTab" hover-class="other-navigator-hover">切换 Tab</navigator> </view> Page({ onLoad: function(options) { this.setData({ title: options.title }) } })

    wx.request里的this不指向外部:

    onLoad (options) {
        let that = this
        wx.request({
          url: app.config.host + '/weiphp/index.php?s=/w16/Cms/Cms/getDetail',
          data: {id: options.id},
          success (res) {
            that.setData({info: res.data})
            // console.log(res.data)
          }
        })
      }

    域名问题:

    1. 使用安全域:
    必须为被认证的已备案的域名,在小程序后台中设置
    
    2. 使用非安全域:
    开发阶段可以使用未校验的域名访问方式,在微信开发者工具中进行设置
  • 相关阅读:
    python 字符串常用操作
    markdown 基础语法
    网络安全入门的16个基本问题
    Linux中20个crontab例子
    使用python爬取一个网页里表格的内容
    浅谈python的深浅拷贝
    Linux中设置普通用户可以su和sudo
    iptables四表五链
    CentOS7编译安装NFS
    源码安装csvn
  • 原文地址:https://www.cnblogs.com/maoriaty/p/9013822.html
Copyright © 2011-2022 走看看