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

互动网站的核心技术wordpress不用插件

互动网站的核心技术,wordpress不用插件,网站做预览文档,专做脚本的网站效果图 鼠标悬浮有对应的文字提示#xff0c;且图标出现背景色和颜色 实现 目前提供五个固定样式的图标及三个用户自定义的图标#xff0c;可根据需要补充 组件代码 script setup langts import { onMounted, PropType, reactive, ref, watch } from v…效果图 鼠标悬浮有对应的文字提示且图标出现背景色和颜色 实现 目前提供五个固定样式的图标及三个用户自定义的图标可根据需要补充 组件代码 script setup langts import { onMounted, PropType, reactive, ref, watch } from vue import Tooltip from /components/Tooltip/src/Tooltip.vue import { useI18n } from vue-i18nconst { t } useI18n()enum BtnType {edit edit,detail detail,delete delete,permission permission,password password,custom1 custom1,custom2 custom2,custom3 custom3 }interface BtnAction {type: BtnTypeicon?: string | undefinedcolor?: string | undefinedshow?: boolean | truetooltip?: string | undefineddisabled?: booleanhref?: string | undefined }const props defineProps({actions: {default: () [],type: Array as PropTypeBtnAction[]} }) const _actions ref(props.actions) // 监听数据变化 watch(() props.actions,(newVal) {_actions.value newVal},{ deep: true, immediate: true } )const getNormalIcon (action: BtnAction, i: number) {switch (action.type) {case BtnType.edit:_actions.value[i].tooltip t(common.edit)return svg-icon:v2-List-write_linecase BtnType.detail:_actions.value[i].tooltip t(queueCalls.details)return svg-icon:v2-List-Contact_linecase BtnType.delete:if (!_actions.value[i].tooltip) {_actions.value[i].tooltip t(common.delete)}return svg-icon:v2-List-delete_linecase BtnType.permission:if (!_actions.value[i].tooltip) {_actions.value[i].tooltip t(manage.user.viewPermissions)}return svg-icon:v2-List-Authority_linecase BtnType.password:if (!_actions.value[i].tooltip) {_actions.value[i].tooltip t(login.reset.ok)}return svg-icon:v2-List-ResetPassword_linedefault:return action.icon} }const getActiveIcon (action: BtnAction) {switch (action.type) {case BtnType.edit:return svg-icon:v2-List-write_facecase BtnType.detail:return svg-icon:v2-List-Contact_facecase BtnType.delete:return svg-icon:v2-List-delete_facecase BtnType.permission:return svg-icon:v2-List-Authority_facecase BtnType.password:return svg-icon:v2-List-ResetPassword_facedefault:return action.icon} }// 根据类型获取点击事件 const getClick (type: BtnType) {switch (type) {case BtnType.edit:return click:editcase BtnType.detail:return click:detailcase BtnType.delete:return click:deletecase BtnType.permission:return click:permissioncase BtnType.password:return click:passwordcase BtnType.custom1:return click:custom1case BtnType.custom2:return click:custom2case BtnType.custom3:return click:custom3default:return } }const isCustom (type: BtnType) {return type.indexOf(custom) ! -1 }// const disableTooltip (action: BtnAction) { // return action.tooltip undefined || action.tooltip // }onMounted(() {// 如果show为false移除该按钮// _actions.value props.actions.filter((action) action.show)// console.log(, _actions) })const emit defineEmits([click:edit,click:detail,click:delete,click:permission,click:password,click:custom1,click:custom2,click:custom3 ]) /scripttemplatediv classactions flex items-center tooltip-appenddiv v-for(action, i) in _actions as BtnAction[] :keyaction.typeTooltip :titleaction.tooltip :disabled!action.tooltipv-btn:disabledaction.disabled undefined ? false : action.disabledv-ifaction.show undefined ? true : action.show:hrefaction.hreftarget_blankv-bindpropsroundedxlclassdefault-btn mr-16px:class{delete-btn: action.type delete,custom-btn: isCustom(action.type)}clickemit(getClick(action.type))size32varianttextcolor#c6c8cdiconIcon size21 classactive-icon :icongetActiveIcon(action) /Icon size21 classnormal-icon :icongetNormalIcon(action, i) //v-btn/Tooltip/div/div /templatestyle scoped langscss .actions {.default-btn:hover {color: var(--el-color-primary) !important;cursor: pointer !important;}.delete-btn:hover {color: #db4b4b !important;}.custom-btn:hover {color: var(--el-color-primary) !important;} } .tooltip-append {.active-icon {display: none;}.normal-icon {display: block;} } .tooltip-append:hover {.active-icon {display: block;}.normal-icon {display: none;} } /style使用方法 图标数据传一个BtnAction数据格式的数组使用默认提供的图标只要一个type字段就可以 click事件根据对应图标类型写click:[type] const actions [{ type: edit },{type: custom1,tooltip: t(common.copy),icon: ph:copy},{type: custom2,tooltip: t(common.export),icon: svg-icon:v2-arrow_download},{ type: delete } ] as any[]ActionBtn:actionsactionsclick:editeditFlowTest(row)click:custom1copyFlow(row)click:custom2exportFlow(row)click:deletedeleteFlow(row) /
http://www.zqtcl.cn/news/514517/

相关文章:

  • 厦门市建设工程交易中心网站怎么自己做游戏软件的app
  • 网站论文参考文献人力资源公司名称大全简单大气
  • 射阳做企业网站哪家好wordpress 进销存
  • 青海个人旅游网站建设wordpress用户名密码加密方式
  • 安徽平台网站建设找哪家wordpress首页加登录
  • 雅安市住房和城乡建设局网站湖南全程电子化服务平台官网
  • dw做的上传网站打不开网页制作培训价格
  • 工程网站怎么做广州做网站平台
  • 成都网站建设 全美深圳定制网站建设
  • 邢台网站建设与制作陕西高速公路建设集团网站
  • 太原 招聘 网站建设 技术经理关于 建设 二级网站
  • 如何做网站店铺的模板著名的响应式网站有哪些
  • 相城区建设网站做网站 设计师很
  • python网站开发好吗广州软件外包
  • 山东能源集团 网站建设对网站建设功能的情况说明
  • 网站设计个人各种类型网站建设口碑好
  • 西安巨久科技网站建设嘚嘚笔记 wordpress主推
  • 杭州利兴建设官方网站上海专业网站建设费
  • 自适应网站制作费用中国建设网官方网站企业登录
  • h5网站和传统网站区别电子商务主要学什么就业方向及前景
  • 凡科建站弊端各学院二级网站建设通报
  • 做网站怎么注册营业执照民制作网站哪家便宜
  • 临沂做进销存网站推广软件公司
  • 网站前端建设唐山网站建设托管
  • 做效果图有哪些网站seo怎么做关键词排名
  • 深圳手机网站开发什么网站可以做英语题
  • 网站优化什么意思图片展示网站
  • 建德做网站米趋外贸网站建设
  • 国外优秀的设计网站八爪鱼磁力搜索引擎
  • 网站建设优化陕西网络营销推广方法与策略