feat(page): add pull-to-refresh and back-to-top component
1. enable pull-down refresh for the target page in pages.json 2. add scroll mixin and back-to-top component for form and formdata pages, show back-to-top button when scrolling down
This commit is contained in:
@@ -1245,6 +1245,7 @@
|
|||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
// #endif
|
// #endif
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
"componentPlaceholder": {
|
"componentPlaceholder": {
|
||||||
"diy-article": "view",
|
"diy-article": "view",
|
||||||
"diy-audio": "view",
|
"diy-audio": "view",
|
||||||
|
|||||||
@@ -14,11 +14,15 @@
|
|||||||
|
|
||||||
<loading-cover ref="loadingCover"></loading-cover>
|
<loading-cover ref="loadingCover"></loading-cover>
|
||||||
<ns-login ref="login"></ns-login>
|
<ns-login ref="login"></ns-login>
|
||||||
|
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import scroll from '@/common/js/scroll-view.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [scroll],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: 0,
|
id: 0,
|
||||||
|
|||||||
@@ -19,17 +19,20 @@
|
|||||||
</block>
|
</block>
|
||||||
<loading-cover ref="loadingCover"></loading-cover>
|
<loading-cover ref="loadingCover"></loading-cover>
|
||||||
<ns-login ref="login"></ns-login>
|
<ns-login ref="login"></ns-login>
|
||||||
|
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import diyForm from '@/components-diy/diy-form.vue';
|
import diyForm from '@/components-diy/diy-form.vue';
|
||||||
|
import scroll from '@/common/js/scroll-view.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
diyForm
|
diyForm
|
||||||
},
|
},
|
||||||
|
mixins: [scroll],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: 0,
|
id: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user