uni-app最常用代码

X.    icon   图标
           

 

X.  显示变量

    export default {
        data() {
            return {
                l_version_info: '', //hongmj: 版本号

 

X. tabBar底部导航栏

pages.json

--------------------------------------------------

    "tabBar": {
        "color": "#7A7E83",
        "selectedColor": "#007AFF",
        "borderStyle": "black",
        "backgroundColor": "#F8F8F8",
        "list": [
            {
                "pagePath": "pages/table/main_table",
                "iconPath": "static/table1.png",
                "selectedIconPath": "static/table2.png",
                "text": "包间"
            },


        ]
    }

 

X. 去除原生导航栏后 需要占位符。。

xxxx.vue -------------------

                                
                                    
                                

app.js ------------------------

/* //hongmj 去除原生导航栏  http://ask.dcloud.net.cn/article/34921 */
    .status_bar {
        height: var(--status-bar-height);
        width: 100%;
    }
    .top_view{
        height: var(--status-bar-height);
        width: 100%;
        position: fixed;
        top: 0;
    }
/* //hongmj 去除原生导航栏  http://ask.dcloud.net.cn/article/34921 */

 

X.  内联样式(动态调整 class 和 style)
            全部
注意: flag_clickQuanBu  是个 自己定义的变量。。。

你可能感兴趣的:(uni-app常用代码)