diff --git a/pages/template/long-list/long-list-page.uvue b/pages/template/long-list/long-list-page.uvue index bf7f90aef3e72865fe4fba5cd80f9fa5ba17f2ad..cfa34b28da3e36e4ab2481f161e08cfe8fd2340b 100644 --- a/pages/template/long-list/long-list-page.uvue +++ b/pages/template/long-list/long-list-page.uvue @@ -2,10 +2,10 @@ - + - + {{item.plugin_name}} @@ -22,8 +22,9 @@ {{item.author_name}} - - + + + {{loadingText}} @@ -81,35 +82,17 @@ } else { return "" } - }, + } }, created() { - this.insertLoadingData() - if (this.preload) { this.loadData(null) } }, methods: { - // TODO 目前 list-item 不支持注释节点 - // 暂时在数据末尾插入一条空数据用于显示 loading - insertLoadingData() { - const loadingData = { - plugin_id: -1, - plugin_img_link: '', - plugin_name: '', - plugin_intro: '', - score: 0, - tags: [], - update_date: '', - author_name: '', - } as ListItem - this.dataList.push(loadingData) - }, refreshData(loadComplete : (() => void) | null) { this.dataList.length = 0 this.$currentPage = 1 - this.insertLoadingData() this.loadData(loadComplete) }, loadData(loadComplete : (() => void) | null) { @@ -131,9 +114,7 @@ return } - // TODO - this.dataList.splice(this.dataList.length - 1, 0, ...responseData.data) - // this.dataList.push(...responseData.data) + this.dataList.push(...responseData.data) if (responseData.data.length == 0) { this.isEnded = true @@ -254,20 +235,12 @@ } .loading { - /* position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; */ - flex:1; - margin: -10px; + padding: 20px; background-color: #f8f8f8; - margin-bottom: 1px; justify-content: center; } .loading-text { - padding: 20px; text-align: center; }