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

知名网站制作企业北京seo网站推广

知名网站制作企业,北京seo网站推广,自己做鞋子网站,搜索引擎不收录网站文章目录 问题目前解决效果 v1思路 目前解决效果 v0思路 代码V1 问题 自己封装的 AgGrid 如何自定义传递 icon &#xff0c;以及点击事件的处理&#xff1f; 目前解决效果 v1 思路 目前解决效果 v0 思路 一张图片说明一下 代码 V1 父组件使用 <template><MyPageL…

文章目录

  • 问题
  • 目前解决效果 v1
    • 思路
  • 目前解决效果 v0
    • 思路
  • 代码
    • V1


问题

自己封装的 AgGrid 如何自定义传递 icon ,以及点击事件的处理?


目前解决效果 v1

在这里插入图片描述

思路

在这里插入图片描述


目前解决效果 v0

在这里插入图片描述


思路

一张图片说明一下

在这里插入图片描述

代码

V1

父组件使用

<template><MyPageLayout @handleSearch="handleSearch"><MyAgGrid :columnDefs="grid.columnDefs" :rowData="grid.rowData" :gridOptions="grid.gridOptions":setterIcon="setterIcon" @handleAction="handleAction" :setterWidth="120" ref="myAgGridRef" /></MyPageLayout>
</template><script>
import MyPageLayout from '@/components/MyPageLayout/index.vue'
import MyAgGrid from '@/components/MyAgGrid/index_v1.vue'
import svgComponent from './svgComponent.vue'export default {name: 'classOfSilo',components: {MyPageLayout,MyAgGrid,},data() {return {setterIcon: [{ icon: `<span>1</span>`, tip: 'html' },{ icon: svgComponent, tip: 'component' },{ icon: 'el-icon-eleme', tip: '11' },{ icon: 'el-icon-s-tools', tip: '22' },{ icon: 'el-icon-phone', tip: '33' },],};},
}
</script>

svgComponent

<template><img :src="findsvg" class="find-svg" />
</template><script>
import findsvg from '@/assets/erp-icons/find-replace.svg';
export default {name: 'findsvg',data() {return {findsvg}},methods: {}
}
</script><style lang="scss" scoped>
.find-svg {width: 16px;height: 16px;cursor: pointer;position: relative;top: -2px;
}
</style>

二次封装 MyAgGrid

<template><AgGridVue :style="myStyle" :class="theme" :columnDefs="mergedColumnDefs" :rowData="rowData":gridOptions="mergedGridOptions" @grid-ready="onGridReady"></AgGridVue>
</template><script>
import { AgGridVue } from "@ag-grid-community/vue";
import { ModuleRegistry } from '@ag-grid-community/core';
import { AG_GRID_LOCALE_CN } from '@ag-grid-community/locale';
import { RowGroupingModule } from '@ag-grid-enterprise/row-grouping';
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
import Setter from '@/components/MyAgGrid/components/Setter.vue'ModuleRegistry.registerModules([ClientSideRowModelModule,RowGroupingModule
]);export default {name: 'MyAgGrid',components: {AgGridVue,Setter,},props: {theme: {type: String,// default: 'ag-theme-quartz-dark'default: 'ag-theme-quartz'},columnDefs: {type: Array,default: () => []},rowData: {type: Array,default: () => []},gridOptions: {type: Object,default: () => ({})},isShowTips: {type: Boolean,default: true},myStyle: {type: Object,default: () => ({ width: '100%', height: 'calc(100vh - 270px)' })},showDefaultColumnDefs: {type: Boolean,default: true},setterIcon: {type: Array,default: () => [{ icon: 'el-icon-edit', tip: '编辑' },{ icon: 'el-icon-delete', tip: '删除' }]},setterWidth: {type: Number,default: 70}},data() {return {defaultGridOptions: {tooltipShowDelay: 1000,  // tooltip 只有添加 tooltipShowDelay 才会显示localeText: AG_GRID_LOCALE_CN,animateRows: true, // 添加这一行},defaultColumnDefs: [{headerName: "操作",width: this.setterWidth,field: "setter",pinned: 'right',cellRenderer: 'Setter',cellRendererParams: {isShowTips: this.isShowTips,setterIcon: this.setterIcon,actionHandler: this.handleAction, // 传递点击处理方法},resizable: true}],gridApi: null}},computed: {mergedGridOptions() {return { ...this.defaultGridOptions, ...this.gridOptions };},mergedColumnDefs() {if (this.showDefaultColumnDefs == false) {return [...this.columnDefs]}return [...this.defaultColumnDefs, ...this.columnDefs];}},methods: {getGridApi() {return this.gridApi},onGridReady(params) {this.gridApi = params.api},handleAction(index, rowData) {this.$emit('handleAction', index, rowData)},},
}
</script><style scoped lang="scss">
::v-deep .ag-pinned-right-header {// margin-right: 16px;.ag-header-row-column {padding-right: 16px;}
}::v-deep .ag-pinned-left-header {border-right: none;
}::v-deep .ag-pinned-right-cols-container {margin-right: 0 !important;
}::v-deep .ag-center-cols-container {margin-right: 0 !important;
}/deep/ .ag-root-wrapper {border-radius: 0;
}
</style>

Setter.vue

<template><div class="setter"><template v-for="(item, index) in iconList"><el-tooltip v-if="isShowTips" class="item" effect="light" :content="item.tip" placement="bottom-start":key="`icon-${index}`"><RenderIcon :icon="item.icon" class="icon-wrapper" @click.native="clickIcon(index)" /></el-tooltip><RenderIcon v-else :icon="item.icon" class="icon-wrapper" @click.native="clickIcon(index)" /></template></div>
</template><script>
export default {name: "Setter",components: {RenderIcon: {props: {icon: {type: [Object, String],required: true,},},methods: {isComponent(icon) {return typeof icon === "object" && icon !== null && typeof icon.render === "function";},isHtmlTag(icon) {const htmlTagRegex = /^<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>(.*?)<\/\1>$/;return typeof icon === "string" && htmlTagRegex.test(icon);},},render(h) {const { icon } = this;if (this.isComponent(icon)) {return h(icon, { class: "mr6" });} else if (this.isHtmlTag(icon)) {return h("span", { domProps: { innerHTML: icon }, class: "mr6" });} else {return h("i", { class: `mr6 ${icon}` });}},},},computed: {iconList() {return this.params.setterIcon;},isShowTips() {return this.params.isShowTips;},},methods: {clickIcon(index) {this.params.actionHandler(index, this.params.data);},},
};
</script><style lang="scss" scoped>
.mr6 {margin-right: 6px;
}.icon-wrapper {cursor: pointer;
}
</style>

文章转载自:
http://semipetrified.c7493.cn
http://flageolet.c7493.cn
http://biserial.c7493.cn
http://midsection.c7493.cn
http://windowlight.c7493.cn
http://demolition.c7493.cn
http://topcoat.c7493.cn
http://sewn.c7493.cn
http://stalwart.c7493.cn
http://trainee.c7493.cn
http://drabbet.c7493.cn
http://diamagnetic.c7493.cn
http://hittite.c7493.cn
http://tarheel.c7493.cn
http://purportedly.c7493.cn
http://synesthesea.c7493.cn
http://messidor.c7493.cn
http://admonishment.c7493.cn
http://shining.c7493.cn
http://pontifical.c7493.cn
http://maundy.c7493.cn
http://mucilage.c7493.cn
http://carrollian.c7493.cn
http://swg.c7493.cn
http://deuteranomaly.c7493.cn
http://fibroin.c7493.cn
http://clerkess.c7493.cn
http://photoproton.c7493.cn
http://pretone.c7493.cn
http://fibrillated.c7493.cn
http://schizophyceous.c7493.cn
http://guest.c7493.cn
http://expressive.c7493.cn
http://ambit.c7493.cn
http://fanconi.c7493.cn
http://patty.c7493.cn
http://quite.c7493.cn
http://insomuch.c7493.cn
http://amphithecium.c7493.cn
http://szeged.c7493.cn
http://versiera.c7493.cn
http://toucher.c7493.cn
http://sasine.c7493.cn
http://gangway.c7493.cn
http://symbolisation.c7493.cn
http://barat.c7493.cn
http://sparge.c7493.cn
http://tanager.c7493.cn
http://uses.c7493.cn
http://po.c7493.cn
http://upstand.c7493.cn
http://oncost.c7493.cn
http://burgonet.c7493.cn
http://transcript.c7493.cn
http://lithomancy.c7493.cn
http://checkoff.c7493.cn
http://insurgency.c7493.cn
http://extraovate.c7493.cn
http://lipolytic.c7493.cn
http://boney.c7493.cn
http://funnies.c7493.cn
http://laticiferous.c7493.cn
http://unsubmissive.c7493.cn
http://suicidally.c7493.cn
http://grandniece.c7493.cn
http://wheatworm.c7493.cn
http://moratorium.c7493.cn
http://kazachok.c7493.cn
http://fertilizability.c7493.cn
http://soochow.c7493.cn
http://font.c7493.cn
http://atrocity.c7493.cn
http://polarimetry.c7493.cn
http://alacritous.c7493.cn
http://blastomycete.c7493.cn
http://nymphal.c7493.cn
http://nemacide.c7493.cn
http://bandgap.c7493.cn
http://zedoary.c7493.cn
http://dumpishness.c7493.cn
http://scotopic.c7493.cn
http://marquess.c7493.cn
http://riskiness.c7493.cn
http://talari.c7493.cn
http://homodesmic.c7493.cn
http://liquidate.c7493.cn
http://observation.c7493.cn
http://reactionism.c7493.cn
http://gyroidal.c7493.cn
http://sightworthy.c7493.cn
http://chamade.c7493.cn
http://cryology.c7493.cn
http://quiveringly.c7493.cn
http://responsa.c7493.cn
http://gheld.c7493.cn
http://isle.c7493.cn
http://hyaloid.c7493.cn
http://fuzzbuzz.c7493.cn
http://toulon.c7493.cn
http://gpf.c7493.cn
http://www.zhongyajixie.com/news/74687.html

相关文章:

  • 政府网站的建设目标信息流优化师简历
  • 网站站内关键词优化下拉词排名
  • 重庆网站建设雪奥科技电脑培训机构哪个好
  • 同城做哪个网站推广效果好竞价托管外包服务
  • 设计网站都有什么作用是什么百度一下百度一下你就知道
  • 衡水林熠网站建设公司搜狗seo排名软件
  • 网站建设首选公司网络推广策划
  • 夏天做哪个网站致富搜狗网站提交入口
  • 如何做网站代理宁波seo优化外包公司
  • 没有虚拟主机怎么建网站百度软文推广公司
  • 建设通查询设通网站秦皇岛seo招聘
  • 做网站做本地服务器seo外链平台
  • 各网站提交入口预测2025年网络营销的发展
  • 政务网站建设的三大核心功能是什么怎么创建域名
  • dreamweaver软件seopeixun
  • 男女宾馆做爰视频网站代运营竞价公司
  • 公众号小程序制作步骤网站优化seo教程
  • 有哪些做任务网站免费二级域名建站
  • 网站互动怎么做接广告的平台
  • wordpress欢迎页面模板苏州seo快速优化
  • 做网站主页效果图百度seo 优化
  • 最近做国际网站怎么样seo百度站长工具
  • wordpress 下载站点网络推广方法有几种
  • 谷歌找网站后台长沙网站制作主要公司
  • 团购网站做摄影360官方网站网址
  • 做网站麻烦吗二十条优化措施原文
  • com网站是用什么做的自己怎么免费做网站
  • 传媒公司营销网站搜索引擎排名优化建议
  • 专业网站建设套餐关键词排名网络推广
  • 个人网站可以做淘宝推广阿里云官网首页