uniapp template
发表于|更新于|📔学习笔记
uniapp 小程序端会把 template 标签变成一个 view 标签,这将会影响 template 上一级设置的 flex 布局
相关推荐
2024-04-21
uniapp 禁止页面滚动
1<view @touchmove.stop.prevent></view> 123moveScroll() { console.log('禁止滚动')} 在子组件的最外层 view 标签中加上 @touchmove.stop.prevent 就可以禁止页面滚动,当然滚动条也就没有了。但是这并不影响父组件的滚动,这是我想要的效果
2023-11-23
uni-app tabbar实现Q弹效果
本篇文章用到了 uni-app 团队出的 uView 框架,如果你还不了解 uView,可以先看看官方文档:uView框架 编写组件 123456789101112131415161718192021222324252627<template> <view> <!-- tabbar --> <u-tabbar :value="current" @change="tabbarChange" :safeAreaInsetBottom="false" > <u-tabbar-item text="病人" :name="0" v-if="checkPermi(['system:app:patient'])"> <view class="tabbar-icon custom-icon...
2024-01-15
uView 表单校验
今天在使用 uView 的表单校验的时候,遇到了一个 BUG,记录一下:表单校验有一项怎么也不通过,重新修改或者获取焦点就没事了,查了很多资料最后终于解决✌️,在 rules 中加上如下代码 12345678910111213{ required: true, message: '请输入住院号', transform(value) { return String(value); }, trigger: ['change', 'blur']},{ type: 'number', message: '请输入数字', trigger: ['change', 'blur']}
2024-01-15
uView 组件 u-popup 弹出层滚动穿透问题
今天在编写小程序的时候遇到了一个 BUG,困扰了我一下午,最后终于解决了,记录一下: uView 组件 u-popup在弹出画布的时候用户在手机端签名滚动条也会跟着滑动,不得不说真的是太恶心了,查了很多资料最后终于解决✌️ H5在 H5 端的时候,我们可以通过 touchmove 事件来阻止滚动穿透,代码如下: 123document.body.removeEventListener('touchmove', this.touchmoveEnd, { passive: false}) 1234touchmoveEnd(e) { e.preventDefault(); e.stopPropagation();} APP在 APP 端的时候,我们可以通过 canvas 的 disable-scroll 属性来阻止滚动穿透,代码如下: 1<canvas :disable-scroll="true" :canvas-id="cid"...
评论