uni-app
weixin_44134551
这个作者很懒,什么都没留下…
展开
-
uni-app 购物车及微信支付
<template> <view class="cart"> <view class="content"> <label for="" v-for="item in list" :key='item.id'> <view class="list"> <view class="left"> <checkbox-group @change="checkboxChange($event,item原创 2021-06-30 14:04:28 · 250 阅读 · 0 评论 -
uni-app 购物车 生成订单列表
<template> <view class="cart"> <view class="content"> <label for="" v-for="item in list" :key='item.id'> <view class="list"> <view class="left"> <checkbox-group @change="checkboxChange($event,item转载 2021-06-15 16:56:09 · 1962 阅读 · 0 评论 -
uni-app 封装ES6 Promise request请求
// es6 promise封装 requestexport default (params)=>{ uni.showLoading({ title : "加载中" }) return new Promise((resolve,reject)=>{ wx.request({ ...params, success(res){ resolve(res) }, fail(err){ reject(err) }, complete原创 2021-06-15 11:00:24 · 274 阅读 · 0 评论 -
uni-app tab选中时居中
源码参考转载 2021-05-31 17:45:12 · 745 阅读 · 0 评论 -
uni-app swiper tab导航切换
<template> <!-- 这里的注意点,使用 scroll-view时,如果想让元素横向也就是X轴排列的话 要注意以下几点: 1、scroll-view不支持flex,默认block; 2、scroll-view设置scroll-x="true"; width: 100%; white-space: nowrap;(这个属性很重要,能不能滑动都看这个属性) 3、子元素设置display: inline-block; 4、子元素内容宽度要超出scroll-view的宽。转载 2021-05-24 09:28:49 · 521 阅读 · 0 评论 -
uni-app 第三方微信登录
<template> <view class="page page-fill"> <!-- header start --> <view class="header"> <view v-if="userLogin"> <image :src="userphoto" class="face"></image> </view> <view v-else> &l原创 2021-05-23 17:29:13 · 173 阅读 · 0 评论 -
uni-app 全局判断 获取用户信息
main.jsimport Vue from 'vue'import App from './App'Vue.config.productionTip = falseApp.mpType = 'app'//检测用户是否登录Vue.prototype.checkLogin = function(userInfo){ if(userInfo !== 'undefined' && userInfo !== ''){ return userInfo;原创 2021-05-23 17:27:10 · 1035 阅读 · 0 评论 -
uni-app 封装手势组件
<!-- --><template> <view @touchstart="handlTouchstart" @touchend="handlTouchend" > <view>swiperaction</view> <slot></slot> </view></template><script> export default { data() {原创 2021-05-21 14:47:07 · 416 阅读 · 0 评论 -
uni-app this作用域的问题
uni.login({ provider: 'weixin', success: function (res) { //此处this指向函数内部,并非全局this,获取不到全局data中定义的code this.code = res.code }})//两种方法解决此问题uni.login({ provider: 'weixin', success: function (res) { //作用域替换 var me = this; me.code = res.code }原创 2021-05-19 11:26:49 · 321 阅读 · 0 评论 -
npm 安装第三方插件(moment.js)
进入项目目录中打开cmd npm init -y 安装完成后出package.json目录npm install moment --save 安装完成后项目目录中出现node_modeles 目录结构如下//页面引用import moment from 'moment';//methods使用console.log(moment(new Date()).format('MM'))//出现当前月份...原创 2021-05-19 10:57:12 · 3733 阅读 · 0 评论 -
node npm报错问题解决
解释的很详细,点击我转载 2021-05-19 09:45:52 · 1193 阅读 · 0 评论 -
uni-app分段器
<template> <view> <view class="uni-padding-wrap uni-common-mt"> <!-- 分段器 导航跳转不同组件 --> <uni-segmented-control :current="current" <!-- 操作数组 --> :values="items.map(v => v.title)" sty.原创 2021-05-18 15:37:57 · 1673 阅读 · 0 评论 -
uniapp组件相互动态传值
components : “helloComp”<!-- 总结组件步骤 1.创建组件页面 2.引入组件 import 组件名 form 路径 3.在引入页面components 中注册 组件名 4.使用组件名即可使用 5.组件动态传值只需更换list数组进行循环输出 --><!-- 定义组件名为helloComp --><template name="helloComp"> <view> <block v-for="原创 2021-05-17 16:39:50 · 1544 阅读 · 0 评论 -
uniApp animation点赞+1动画
<!-- <block v-for="(guess,gindex) in guessList"> --> <!-- 动画第一步 标签内定义:animation="animationData" if为多个那么animationDataArr[index] --> <view :animation="animationData" class="animation-opacity" @click="praiseMe">+1</view&g..原创 2021-04-21 10:36:33 · 1457 阅读 · 0 评论