提交 ed6f0b9f 编写于 作者: H hdx

feat(pageStyle): 优化示例

上级 02297533
...@@ -10,11 +10,14 @@ ...@@ -10,11 +10,14 @@
</view> </view>
<button class="btn btn-get-page-style" type="default" @click="getPageStyle">getPageStyle</button> <button class="btn btn-get-page-style" type="default" @click="getPageStyle">getPageStyle</button>
<button class="btn btn-set-page-style-1" type="default" @click="setPageStyle(true)">setPageStyle(true)</button> <button class="btn btn-set-page-style-1" type="default" @click="setPageStyle(true)">setPageStyle(true)</button>
<button class="btn btn-set-page-style-0" type="default" @click="setPageStyle(false)">setPageStyle(false)</button> <button class="btn btn-set-page-style-0" type="default" @click="setPageStyle(false)">setPageStyle(false)</button>
<textarea class="textarea" :value="pageStyleText" :maxlength="-1" :auto-height="true"></textarea> <text class="page-style">当前 PageStyle</text>
<text class="tips"> <text class="page-style-value">{{pageStyleText}}</text>
当前版本仅支持设置属性 enablePullDownRefresh <text class="status">状态:</text>
</text> <view class="status-list">
<text>enablePullDownRefresh: {{enablePullDownRefreshStatus}}</text>
</view>
<text class="tips">当前版本仅支持设置属性 enablePullDownRefresh</text>
</view> </view>
</template> </template>
...@@ -29,7 +32,9 @@ ...@@ -29,7 +32,9 @@
return { return {
checked: false, checked: false,
pages: [] as Page[], pages: [] as Page[],
currentPageStyle: {} as UTSJSONObject currentPageStyle: {} as UTSJSONObject,
// TODO
enablePullDownRefreshStatus: true
} }
}, },
computed: { computed: {
...@@ -62,13 +67,14 @@ ...@@ -62,13 +67,14 @@
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
this.currentPageStyle = currentPage.$getPageStyle(); this.currentPageStyle = currentPage.$getPageStyle();
}, },
setPageStyle(epr : boolean) { setPageStyle(enable : boolean) {
// 目前仅支持 enablePullDownRefresh // 目前仅支持 enablePullDownRefresh
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
currentPage.$setPageStyle({ currentPage.$setPageStyle({
enablePullDownRefresh: epr enablePullDownRefresh: enable
}); });
this.enablePullDownRefreshStatus = enable
}, },
// getCurrentPage(): Page { // getCurrentPage(): Page {
// const pages = getCurrentPages(); // const pages = getCurrentPages();
...@@ -83,18 +89,30 @@ ...@@ -83,18 +89,30 @@
<style> <style>
.btn { .btn {
margin-top: 10px; margin-top: 10px;
}
.page-style {
margin-top: 15px;
} }
.textarea { .page-style-value {
margin-top: 5px; margin-top: 5px;
padding: 5px; padding: 5px;
background-color: #fff; background-color: #fff;
width: 100%; width: 100%;
}
.status {
margin-top: 20px;
}
.status-list {
margin-top: 5px;
} }
.tips { .tips {
font-size: 12px; font-size: 12px;
margin-top: 10px; margin-top: 15px;
opacity: .8; opacity: .8;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册