uni-app

263 阅读1分钟

1、easycom组件规范:只要组件安装在项目的components目录下或uni_modules目录下,并符合components/组件名称/组件名称.vue目录结构。就可以不用引用、注册,直接在页面中使用

2、navbar在安卓中左对齐,IOS居中,可以用自定义navbar代替,小程序中胶囊位置会遮挡元素,需要单独处理。

3、设置H5代理(mainfest.json源码视图)

"h5": {
    "router": {
        "mode": "history"
    },
    "devServer": {
        "port": 8080, //端口
        "disableHostCheck": true,
        "proxy": {
            "/jeecg": {
                "target": "http://xxxxxx/", //目标接口域名
                "changeOrigin": true, //是跨域
                "secure": false
            }
        }
    }
}

###微信小程序

1、新手初次使用,运行小程序,启动微信开发者工具失败,需要进行设置。 开发者工具,进入设置界面,切换到安全选项,勾选服务端口

2、TypeError: Cannot read property 'forceUpdate' of undefined 需要配置AppID manifest.json

3、undefined null 会在页面上渲染出来需要加判断转空字符串

4、不能直接在template中使用store undefined