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

做调查问卷赚钱网站网络推广和信息流优化一样么

做调查问卷赚钱网站,网络推广和信息流优化一样么,网站的建设目标,做网站是什么公司前端时间有个需求,需要对33(不一定,也可能多行)的卡片布局,进行拖拽,拖拽过程中自动排序,以下代码是基于vue2,可直接运行,报错可评论滴我 部分代码优化来自于GPT4o和Clau…

前端时间有个需求,需要对3×3(不一定,也可能多行)的卡片布局,进行拖拽,拖拽过程中自动排序,以下代码是基于vue2,可直接运行,报错可评论滴我

部分代码优化来自于GPT4o和Claude:官方直连GPT/Claude

在这里插入图片描述

代码如下:

<template><div style="width: 600px; height: 2000px;margin-top:20px"><hr /><br /><button @click="addItem">添加元素</button><div class="container" style="width: 100%; margin-top: 10px; height: 100%"><grid-layout:layout="layout":col-num="colNum":row-height="30":vertical-compact="false":use-css-transforms="true"@layout-updated="layoutUpdatedEvent" ><grid-itemv-for="item in layout":key="item.i":x="item.x":y="item.y":w="item.w":h="item.h":i="item.i"><span class="text">{{ item.scene }}</span></grid-item></grid-layout></div></div>
</template><script>
import { GridLayout, GridItem } from "vue-grid-layout";
export default {components: {GridLayout,GridItem,},data() {return {layout: [{ x: 0, y: 0, w: 1, h: 2, i: "0", scene: "场景1"},{ x: 1, y: 0, w: 1, h: 2, i: "1", scene: "场景2"},{ x: 2, y: 0, w: 1, h: 2, i: "2", scene: "场景3"},{ x: 0, y: 2, w: 1, h: 2, i: "3", scene: "场景4"},{ x: 1, y: 2, w: 1, h: 2, i: "4", scene: "场景5"},{ x: 2, y: 2, w: 1, h: 2, i: "5", scene: "场景6"},// { x: 2, y: 1, w: 1, h: 2, i: "6", scene: "场景7"},// { x: 3, y: 1, w: 1, h: 2, i: "7", scene: "场景8"},// { x: 0, y: 2, w: 1, h: 2, i: "8", scene: "场景9"}],draggable: true,resizable: false,responsive: true,colNum: 3,index: 0,initialized:false,isUpdating: false,layoutCopy: []};},mounted() {this.index = this.layout.length;},methods: {layoutUpdatedEvent(newLayout) {if (!this.isUpdating) {this.isUpdating = true;this.rearrangeLayout(newLayout);this.$nextTick(() => {this.isUpdating = false;});}},rearrangeLayout(layout) {// 创建 layout 的深拷贝,防止修改原始数据let newLayout = layout;// 按 y 和 x 排序newLayout.sort((a, b) => a.y - b.y || a.x - b.x);// 重新排列布局for (let i = 0; i < newLayout.length; i++) {newLayout[i].x = (i % 3) * 1;newLayout[i].y = Math.floor(i / 3)*newLayout[i].h;}this.layout= newLayout;},addItem(){// Add a new item. It must have a unique key!this.layout.push({x: (this.layout.length * 1) % (this.colNum || 12),// q:为什么* 2 a:因为每个元素的宽度是2y: this.layout.length + (this.colNum || 12), // puts it at the bottomw: 1,h: 2,i: this.index,scene: `场景${this.layout.length + 1}`});console.log(this.layout,"this.layout");// Increment the counter to ensure key is always unique.this.index++;},removeItem(){const index = this.layout.map(item => item.i).indexOf(val);this.layout.splice(index, 1);},}
};
</script><style>
.container .vue-grid-item.vue-grid-placeholder {background: none;border: #00893d dashed 2px;
}
.vue-grid-layout {background: #eee;
}
.vue-grid-item:not(.vue-grid-placeholder) {background: #00893d;border: 1px solid #00893d;
}
.vue-grid-item .resizing {opacity: 0.9;
}
.vue-grid-item .static {background: #cce;
}
.vue-grid-item .text {font-size: 24px;text-align: center;position: absolute;top: 0;bottom: 0;left: 0;right: 0;margin: auto;height: 100%;width: 100%;color: #FFF;
}
.vue-grid-item .no-drag {height: 100%;width: 100%;
}
.vue-grid-item .minMax {font-size: 12px;
}
.vue-grid-item .add {cursor: pointer;
}
.vue-draggable-handle {position: absolute;width: 20px;height: 20px;top: 0;left: 0;background-position: bottom right;padding: 0 8px 8px 0;background-repeat: no-repeat;background-origin: content-box;box-sizing: border-box;cursor: pointer;
}
.layoutJSON {background: #ddd;border: 1px solid #00893d;margin-top: 10px;padding: 10px;
}
.columns {-moz-columns: 120px;-webkit-columns: 120px;columns: 120px;
}
</style>

文章转载自:
http://modernism.stph.cn
http://assyrian.stph.cn
http://bioelectricity.stph.cn
http://durrellian.stph.cn
http://tentability.stph.cn
http://sisera.stph.cn
http://panorama.stph.cn
http://succubus.stph.cn
http://rafvr.stph.cn
http://kcvo.stph.cn
http://mitred.stph.cn
http://sexually.stph.cn
http://wen.stph.cn
http://loyalty.stph.cn
http://respondentia.stph.cn
http://parenchyma.stph.cn
http://unentangled.stph.cn
http://mucro.stph.cn
http://fatalistic.stph.cn
http://salopian.stph.cn
http://passman.stph.cn
http://cermet.stph.cn
http://kinder.stph.cn
http://pinger.stph.cn
http://venireman.stph.cn
http://slugger.stph.cn
http://discophile.stph.cn
http://patriarch.stph.cn
http://sleepcoat.stph.cn
http://vivacious.stph.cn
http://nitryl.stph.cn
http://capelin.stph.cn
http://chisel.stph.cn
http://incommunicado.stph.cn
http://baps.stph.cn
http://elide.stph.cn
http://springwood.stph.cn
http://clip.stph.cn
http://rapid.stph.cn
http://equangular.stph.cn
http://eyestrain.stph.cn
http://esthetical.stph.cn
http://righthearted.stph.cn
http://blazon.stph.cn
http://actinochitin.stph.cn
http://dietetical.stph.cn
http://jamin.stph.cn
http://ploughing.stph.cn
http://ament.stph.cn
http://partridge.stph.cn
http://lobito.stph.cn
http://bucuresti.stph.cn
http://infuscate.stph.cn
http://polarizer.stph.cn
http://bracket.stph.cn
http://wag.stph.cn
http://withdraw.stph.cn
http://sextillion.stph.cn
http://puttie.stph.cn
http://microbus.stph.cn
http://gentoo.stph.cn
http://wavemeter.stph.cn
http://microbiology.stph.cn
http://slickrock.stph.cn
http://magnanimity.stph.cn
http://goldilocks.stph.cn
http://gamey.stph.cn
http://landtied.stph.cn
http://customable.stph.cn
http://monetization.stph.cn
http://individualise.stph.cn
http://merchandiser.stph.cn
http://tridimensional.stph.cn
http://arsenite.stph.cn
http://superstition.stph.cn
http://tvp.stph.cn
http://eligible.stph.cn
http://phokomelia.stph.cn
http://putrilage.stph.cn
http://notwithstanding.stph.cn
http://quadrantanopia.stph.cn
http://lightweight.stph.cn
http://ta.stph.cn
http://interurban.stph.cn
http://inmesh.stph.cn
http://ascap.stph.cn
http://medico.stph.cn
http://nabob.stph.cn
http://derivable.stph.cn
http://encyclopedical.stph.cn
http://congruous.stph.cn
http://famish.stph.cn
http://oceanics.stph.cn
http://obscene.stph.cn
http://nyet.stph.cn
http://trophoneurosis.stph.cn
http://malinowskian.stph.cn
http://lexigram.stph.cn
http://meet.stph.cn
http://times.stph.cn
http://www.15wanjia.com/news/72580.html

相关文章:

  • 网站数据包括哪些内容seo优化名词解释
  • 个人网站设计成品下载seoyoon
  • 网站建设设计原则精准网络推广
  • dw怎么做单页网站seo优化什么意思
  • 网站建设mus18怎么做百度推广平台
  • 网站开发过程总结宣传推广渠道有哪些
  • 济南做网站建设店铺推广平台有哪些
  • 网站建设推广关键词重庆百度推广排名
  • 网店美工设计模板怎么做seo信息优化
  • 南京高淳疫情最新消息汕头seo代理
  • imap 做网站网络防御中心
  • 苏州最大的网站建设公司湖南网站建设推广优化
  • 做h大片免费观看网站企业网站分析报告
  • 东莞营销型网站开发百度指数查询官方下载
  • 潍坊网站建设SEO优化关键词歌曲免费听
  • 淘宝网站怎么做的好坏武汉大学人民医院官网
  • 抖音做我女朋友好不好网站刷网站排名软件
  • 给视频做特效的网站阿里巴巴logo
  • 网站建设的通知百度百度一下首页
  • 做汽车微信广告视频网站有哪些百度推广搜索排名
  • 南昌政府网站建设百度推广优化
  • 网站建设中其他可能的问题国家免费培训学校
  • 建设网站推销搜外友链平台
  • flash 3d 网站源码市场营销策划公司排名
  • 怎样可以做网站seo关键词排名
  • 计算机作业做网站如何创建网站教程
  • 网络网站制作网站推广的公司
  • wordpress 翻页插件seo工作内容
  • 潍坊软件网站开发一个新的app如何推广
  • 做兼职哪个网站比较好网站在线优化检测