diff --git a/README.md b/README.md index 3818156..b3277f0 100644 --- a/README.md +++ b/README.md @@ -55,4 +55,71 @@ config.header['platform'] = 'APP' +``` + +# 以下为复杂页面的完整配置参数 + +```json + { + "path": "pages/index/index", // 首页 + "style": { + "navigationBarTitleText": "首页", // 页面标题 + "enablePullDownRefresh": true, // 开启下拉刷新 + "backgroundColor": "#F8F8F8", // 导航栏背景颜色 + "onReachBottomDistance": 100, // 设置页面上拉触底事件触发时距离页面底部的距离,默认是50px + "app-plus": { // 以下是App平台特有配置 + "titleNView": { + "titleSize": "16px" // App端原生导航栏标题字体大小 + "titleColor": "#fff", + "buttons": [{ // 导航栏右侧按钮,下面是使用icon展示的示例 + "text": "\ue60f", + "fontSize": "30px", + "fontSrc": "/static/iconfont.ttf" + }] + } + } + } +} +``` + +## 以下为底部按钮列表的使用方式 +```js +//按钮列表的引入 +import bottomBtnGroup from '@/components/bottomBtn/bottomBtnGroup.vue' +//注册组件 +components: { + bottomBtnGroup +}, +//UI 引用 + +// vue Data定义 + data() { + return { + //form 底部按钮栏配置 + bottomBtnList: [{ + label: "新增", + type: "primary", + event: (done) => { // 接收 done 回调 // ✅ 箭头函数,this 指向组件 + setTimeout(() => { + // // 在这里执行你想要延迟执行的函数或代码 + console.log("延时5秒") // 调用你的函数 + this.containCallMethods(done);//你需要执行的方法 + }, 5000); + //this.containCallMethods(done); + }, + }, + { + label: "取消", + type: "primary", + event: function() { + //方式2: + return new Promise(resolve => { + console.log("取消方法完成") + setTimeout(resolve, 5000); + }); + } + }, + ], + } +} ``` \ No newline at end of file diff --git a/components/bottomBtn/bottomBtnGroup.vue b/components/bottomBtn/bottomBtnGroup.vue new file mode 100644 index 0000000..7e1f780 --- /dev/null +++ b/components/bottomBtn/bottomBtnGroup.vue @@ -0,0 +1,299 @@ + + + + + + \ No newline at end of file