
uniapp
扬州的你
向大家学习
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
懒加载
懒加载<template> <view> <scroll-view :scroll-into-view="'ss' + current" :scroll-x="true" style="background-color: #007AFF; padding-top: 20px; position: fixed; top: 0; left: 0; right: 0; z-index: 2;" > <view class="tab"&g原创 2021-05-06 17:42:54 · 69 阅读 · 0 评论 -
uniapp的页面和组件的下拉刷新
组件的下拉刷新<template> <scroll-view :refresher-triggered="refreshing" :refresher-enabled="true" @refresherrefresh="onRefresh" @scrolltolower="loadmore" v-if="data" :scroll-y="true" :style="{height:wh-40+'px'}"> <uni-list>原创 2021-05-06 17:06:31 · 1222 阅读 · 0 评论 -
uniapp实现自定义滚动条。
uniapp实现自定义滚动条。笔记重点:需要给每个text绑定一个id,但是id不能是数字开头,所以在前面加一个s或者其他字母。然后scroll-into-view定位到“sscurrent”,当sscurrent=ssindex,scroll会自动定位过去<template> <view> <scroll-view :scroll-into-view="'ss'+current" scroll-x="true" style="background-color: #原创 2021-05-05 17:34:01 · 4537 阅读 · 0 评论 -
div中只有一张图片时,底部会有空白,需要加lineheight:0
div中只有一张图片时,底部会有空白,需要加lineheight:0<template> <view class="" v-if="data"> <uni-grid :column="2" :square="false" :showBorder="false"> <uni-grid-item v-for="(item,index) in data.list" :key="index"> <view class="item"原创 2021-04-29 22:22:13 · 216 阅读 · 0 评论 -
uniapp下拉刷新,锚点等功能实现
uniapp下拉刷新,锚点等功能实现<template> <!-- v-if : 防止网络请求完毕之前的 DOM 加载 --> <!-- scroll-view 专门的滚动组件, 拥有更多的功能 --> <!-- scroll-y: 允许竖向滚动, 默认 false --> <!-- 必须指定高度, 否则无法竖向滚动 --> <!-- @scrolltolower: scroll-view 的触底事件 --> <s原创 2021-04-29 21:06:41 · 543 阅读 · 0 评论 -
uniapp栅格事件委托
使用@change="chooseHero“监听栅格中所有子组件的点击事件<template> <view class=""> <uni-grid :column="3" :square="false" @change="chooseHero"> <uni-grid-item v-for="(item,index) in hero" :index="index" :key="index"> <view style="disp原创 2021-04-29 20:01:10 · 1447 阅读 · 1 评论 -
css 文本两行显示,超出省略号表示
css 文本两行显示,超出省略号表示重点:text-overflow: ellipsis;只对display:inline;起作用例子:我说说打瞌睡党风建设打火机说说色儿a{display:block/inline-block;width:100px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}b{display:inline; //正确display:inline-block //错误,b标签里的字超原创 2021-04-26 16:54:26 · 129 阅读 · 0 评论 -
一个前端报错技术细节
问题:当data为null时,报错data不能为null原因:在网页还没有请求数据,页面v-for就执行了,所以此时的data还没有赋值数组。解决办法:在html中加入v-if=“data”,当data!=null时才渲染页面。<template> <view v-if="data!=null" class=""> <uni-list> <uni-list-item v-for="(item,index) in data.data" :k原创 2021-04-25 23:49:15 · 223 阅读 · 0 评论 -
uniapp的生命周期
**1.应用的周期:App.vue中2.页面:onload onShow onHide3.组件:同vue**原创 2021-04-25 17:57:22 · 113 阅读 · 0 评论