Coder Social home page Coder Social logo

miniprogramdemo's Introduction

项目配置及修改项

  1. 使用开发工具push代码,需要在Source Control-Setting-Network and Auth的Auth部分选择Use username and password,并输入用户和密码
  2. index.wxml代码中的modecover?搜索之后说是遗留代码问题,不过现在还没改过来
    //aspectFit
    <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="aspectFit"></image>
  3. index.js里面的getUserInfo方法和系统方法重名,改为onGetUserInfo
  4. sitmap.json可配置页面是否被索引,搜索时是否被微信爬虫爬到页面
    (1) 默认为allow,*所有页面都可以被索引
    "rules": [
        {
          "action": "allow",
          "page": "*"
        }
      ]
    (2) 某个页面不被索引
    "rules": [
        {
          "action": "disallow",
          "page": "pages/logs/logs"
        },
        {
          "action": "allow",
          "page": "*"
        }
      ]
    (3) 同时包含a,b两个参数的页面会被索引,其他不会
    "rules": [
        {
          "action": "allow",
          "page": "path/to/page",
          "params": ["a", "b"],
          "matching": "inclusive"
        }, 
        {
          "action": "disallow",
          "page": "*"
        }
      ]
  5. logs.wxml页面报错 Now you can provide attr wx:key for a wx:for to improve performance.
    wx:key用于标识每个item,
    当数据改变触发渲染层重新渲染时,会校正带有key的组件,会重新排序而不是重新创建,提高渲染效率,
    wx:forwx:for-item之间加wx:key,值设置为*this代表当前item自身即可
  6. 开发工具中Side Bar里面push代码会一直等待,push不成功,使用Tool Bar里面的Source Control可以
  7. 微信开放文档小程序开发指南,虽然有些东西是重复的,但是建议还是都看一遍。
    原来小程序开发指南是一本书,详细介绍如何进行小程序开发,按顺序应该先看一遍微信开放文档的指南部分,然后再来详细看一遍这本书。
  8. 小程序的开发模式: MVVM 的开发模式(类似 React, Vue),把渲染和逻辑分离。简单来说就是不要再让 JS 直接操控 DOMJS 只需要管理状态即可,然后再通过一种模板语法来描述状态和界面结构的关系即可。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.