当前位置: 首页 > news >正文

wordpress 搭建网站亚马逊外贸网站如何做

wordpress 搭建网站,亚马逊外贸网站如何做,网站宝建站,南宁哪里做网站vue3 setupTaro3 调用原生小程序自定义年月日时分多列选择器#xff0c;NutUI改造 NutUI 有日期时间选择器#xff0c;但是滑动效果太差#xff0c;卡顿明显。换成 原生小程序 很顺畅 上代码#xff1a; templateviewpickermodemultiSelectorTaro3 调用原生小程序自定义年月日时分多列选择器NutUI改造 NutUI 有日期时间选择器但是滑动效果太差卡顿明显。换成 原生小程序 很顺畅 上代码 templateviewpickermodemultiSelectorchangeconfirmPickercolumnChangescrollColumnChange:valuecolumnVal:rangemultiArraynut-celltitle选择时间:descshowValclickcopyColumnVal columnVal/nut-cell!-- view clickcopyColumnVal columnVal当前选择{{ showVal }}/view --/picker/view /templatescript setup import { ref, onMounted, watch } from vue; const multiArray ref(undefined); // 列可选列表 const columnVal ref(undefined); // 列当前选中值 const copyColumnVal ref(undefined); // 记录滚动中数据 const showVal ref(undefined); // 显示后年月日时分// 个位数时 补0 const add0 (num) String(num 9 ? num : 0 num);// 判断平年闰年 const resYearType (year) (year % 4 0) (year % 100 ! 0) || year % 400 0;// 获取当前时间 const getNowT (timeInfo) {// timeInfo 为 年月日字符串 或者 时间戳var nowT new Date(timeInfo);return {year: nowT.getFullYear(),month: nowT.getMonth() 1,day: nowT.getDate(),hour: nowT.getHours(),minute: nowT.getMinutes(),second: nowT.getSeconds(),}; };// 设置当前时间 - columnVal每列索引数组集合 function setNowTime(timeStr) {const timeObj getNowT(timeStr); // timeObj 为 { year, month, day... }const { year, month, day, hour, minute } timeObj;// 获取滚动列表数据const [years,months,days,hours,minutes,] multiArray.value;const yearsIdx years.findIndex((item) item year);const monthsIdx months.findIndex((item) item month);const daysIdx days.findIndex((item) item day);const hoursIdx hours.findIndex((item) item hour);const minutesIdx minutes.findIndex((item) item minute);columnVal.value [yearsIdx, monthsIdx, daysIdx, hoursIdx, minutesIdx];showVal.value ${year}/${add0(month)}/${add0(day)} ${add0(hour)}:${add0(minute)};// 根据当前时间初始化可选择日期时间setDaysList(columnVal.value) }// 初始化时间 function initColumn(daysNum 31) {// 年const yearStart 2000; // 年 - 开始时间const yearLength 100; // 年 - 列表长度const years Array.from({ length: yearLength }).map((i, idx) add0((idx yearStart)));// 月const months Array.from({ length: 12 }).map((i, idx) add0((idx 1)));// 日const days Array.from({ length: daysNum }).map((i, idx) add0((idx 1)));// 时const hours Array.from({ length: 24 }).map((i, idx) add0((idx 0)));// 分const minutes Array.from({ length: 60 }).map((i, idx) add0((idx 0)));multiArray.value [years,months,days,hours,minutes,]; }// 滚动设置可选天数 28 - 29 - 30 - 31 function setDays(daysNum 31) {multiArray.value[2] Array.from({ length: daysNum }).map((i, idx) add0((idx 1)));// 深拷贝下否则不动态修改列multiArray.value JSON.parse(JSON.stringify(multiArray.value)); }// 修改每月的天数 function setDaysList(columnArr) {const [yearsIdx, monthsIdx] columnArr;const [years] multiArray.value;// 当选择2月if (monthsIdx 1) {// 如果闰年if (resYearType(years[yearsIdx])) {setDays(29);} else {setDays(28);}} else if ([1, 3, 5, 7, 8, 10, 12].includes(monthsIdx 1)) {// 当选择1, 3, 5, 7, 8, 10, 12月setDays(31);} else {setDays(30);} }// 确认选中结果 function confirmPicker(e) {columnVal.value e.detail.value;const [yearsIdx, monthsIdx, daysIdx, hoursIdx, minutesIdx] e.detail.value;const [years, months, days, hours, minutes] multiArray.value;showVal.value ${years[yearsIdx]}/${months[monthsIdx]}/${days[daysIdx]} ${hours[hoursIdx]}:${minutes[minutesIdx]}; }// 滚动事件未点击确定 function scrollColumnChange(e) {const { column, value } e.detail;copyColumnVal.value[column] value;setDaysList(copyColumnVal.value);console.log(修改的列为, column, 值为, value); }// 初始化 onMounted(() {initColumn();// 回显时间setNowTime(new Date().getTime()); });// 监听传递日期 const props defineProps({propsTime: {type: String,default: } }) watch(props.propsTime, (newValue, oldValue) {console.log(值发生了变更, newValue, oldValue);// 回显时间setNowTime(newValue); });/script 若需要自定义年开始时间见 initColumn 方法 如作为组件通过父级传递可使用
http://www.dnsts.com.cn/news/184558.html

相关文章:

  • 网站模板免费下载中文版jsp网站开发详细教程
  • 微信官方网站登陆网站建设实例分析
  • 西峰住房和城乡建设局网站做海外网站的公司
  • 广东建设工程执业资格注册中心网站微商代理网
  • 网站建设补贴建设国际互联网网站
  • 青岛做网站公wordpress已运行时间
  • 各大网站的软文怎么做有比wordpress更好的吗
  • 门户网站怎么创建玛多县网站建设公司
  • 做网站要多少钱一个成都网站建设app开发
  • vue 做电商网站可以用来做论文引用的网站
  • 网站后台数据库怎么做平面网站模版
  • 网站被k后是怎样的开发 网站 费用
  • 怎么看网站有没有被kwordpress扫码跳转
  • 专业网站制作公司招聘网络优化网站 s
  • jsp做的网站运行都需要什么wordpress自定义api
  • 中国建设银行陕西省分行网站万家建设有限公司网站
  • 百度搜不到 但搜关键词有的网站沈阳专业seo
  • 网站开发电销常遇到问题网站空间源码
  • 浏览器正能量网站免费互动网页设计是什么
  • 建设银行龙卡信用卡官方网站南宁有做门户网站的公司吗
  • 网站怎么做百度的关键字宁波网站推广有哪些
  • 挖金矿游戏网站建设天律网站建设
  • 个人可以做电视台网站吗联想北京有限公司
  • 手机网站大全观看网站seo方案模板
  • 余杭门户网站西安建设工程交易中心官网
  • 用html做静态网站绵阳网站建设 科雨网络
  • 专业网站建设服务包括哪些宝塔wordpress公网访问
  • 西安百度网站排名优化深圳企业排名100强
  • 优享微信网站建设安装wordpress前出现500 错误
  • 国外做爰网站百度搜索排名怎么做