uni-app
if时光重来
这个作者很懒,什么都没留下…
展开
-
uniapp获取当前日期时间
这里使用的是封装式写法,使用时需要用到import引入1.common/getdateTime.js/** * @param {String} str (y-m-d h:i:s) y:年 m:月 d:日 h:时 i:分 s:秒 */function dateTimeStr(str){ var date = new Date(), year = date.getFullYear(), //年 month = date.getMonth() + 1, //月 day = date.getDat原创 2021-06-26 06:01:55 · 7776 阅读 · 7 评论 -
uniapp picker多列选择器定义年月日时分秒组件
dateTimePicker.js/** * 自定义多列时间选择器 */function withData(param) { return param < 10 ? '0' + param : '' + param;}function getLoopArray(start, end) { var start = start || 0; var end = end || 1; var array = []; for (var i = start; i <= end;转载 2021-06-22 16:46:39 · 5249 阅读 · 9 评论 -
uniapp封装公共js并在main.js里全局绑定并调用
公共文件:common/api.js// 请求头var rqUrl = '域名'// 请求处理function requst(url, data, post_get) { return new Promise((resolve, reject) => { uni.request({ url: this.rqUrl + url, method: post_get || "GET", data: data || {}, header: { 'content-t原创 2021-06-22 14:51:39 · 6283 阅读 · 2 评论 -
uniapp获取当前时间
getTime:function(){var date = new Date(),year = date.getFullYear(),month = date.getMonth() + 1,day = date.getDate(),hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),minute = date.getMinutes() < 10 ? "0" + date.getMinutes()转载 2021-06-22 14:29:47 · 9699 阅读 · 2 评论 -
uniapp 实现在当前页面改变props中定义的值
官方文档:https://uniapp.dcloud.io/vue-components?id=props在父组件中赋值时加上 .sync,在子组件中使用 this.$emit(‘update:title’,“uni-app”)改变值.sync 修饰符当一个子组件改变了一个 prop 的值时,这个变化也会同步到父组件中所绑定。 .sync 它会被扩展为一个自动更新父组件属性的 v-on 监听器。 <!-- 父组件 --> <template> <原创 2021-06-22 11:36:43 · 4928 阅读 · 0 评论 -
uniapp实现自定义拍照窗口
注:这里使用的是camera组件,只支持部分小程序详细参数参看开发文档https://uniapp.dcloud.io/component/camera?id=camera最终效果图:代码:<template> <view> <!-- 摄像头区域 --> <camera :device-position="devPosition" flash="off" @error="error" style="width: 100%;" :style="{h原创 2021-06-21 16:14:16 · 4916 阅读 · 0 评论 -
uniapp实现自定义导航时动态获取导航栏的高度
<view class="header" :style="'height:'+height+'px'"> <icon class="iconfont icon-xiangyou"></icon> <text>返回</text> </view>```<script> export default { data() { return { height: 30 } }, on原创 2021-06-09 11:06:28 · 2276 阅读 · 0 评论 -
uniapp实现左右滑动
<template> <view class="content"> <view class="model_box"> <view class="model_title">推广营销</view> <view class="model_scrollx flex_row"> <scroll-view class="uni-swiper-tab" scroll-x :style="'height:'+scro..原创 2021-06-07 10:01:06 · 8102 阅读 · 1 评论 -
uniapp实现自定义tabbar导航点击跳转
首先先在pages.josn中把需要tabBar设置好:只需要将页面路径放进去就可以"tabBar": { "selectedColor":"#79D5AD", "color": "#999999", "backgroundColor":"#ffffff", "borderStyle": "white", "height":"0px", "list": [{ "pagePath":"pa转载 2021-05-31 10:04:07 · 5205 阅读 · 1 评论 -
uni-app开发的微信小程序隐藏返回首页按钮
// #ifdef MP-WEIXIN if(wx.hideHomeButton){ wx.hideHomeButton(); } // #endif转载 2021-05-31 09:59:31 · 2849 阅读 · 0 评论 -
uniapp获取元素高度
uni.getSystemInfo({ success: function(res) { // res - 各种参数 console.log(res.windowWidth); // 屏幕的宽度 let info = uni.createSelectorQuery().select(".类名"); info.boundingClientRect(function(data) { //data - 各种参数 console.log(data.width)转载 2021-05-28 13:27:05 · 4981 阅读 · 4 评论 -
阿里矢量图在uniapp中的使用
在App.vue文件的style中引用iconfont.css文件,最好是放在style中的最上面@import url(“static/css/iconfont.css”);使用方法转自:https://blog.csdn.net/dabao87/article/details/107175104转载 2021-05-28 13:19:33 · 124 阅读 · 0 评论