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

做五金国际网站哪个好seo岗位工资

做五金国际网站哪个好,seo岗位工资,一个产品有两个品牌怎么做网站,360免费wifi电脑版需求&#xff1a;根据数据中的html&#xff0c;因为我是在做填空&#xff0c;所以是需要将html中的_____替换成input&#xff0c;由于具体需求我使用的是元素contenteditable代替的可编辑的input html部分 <div class"wrap"><component :is"rendered…

需求:根据数据中的html,因为我是在做填空,所以是需要将html中的_____替换成input,由于具体需求我使用的是元素contenteditable代替的可编辑的input

html部分

<div class="wrap"><component :is="renderedContent" ref="wrap_component" /></div>

js部分

// 这个是为了保证输入的时候光标保持在最后
const moveCursorToEnd = (element: HTMLElement) => {const range = document.createRange();const selection = window.getSelection();// 找到最后一个文本节点let lastTextNode: Text | any = null;const traverseNodes = (node: Node) => {if (node.nodeType === Node.TEXT_NODE) {lastTextNode = node as Text;}for (let i = 0; i < node.childNodes.length; i++) {traverseNodes(node.childNodes[i]);}};traverseNodes(element);if (lastTextNode) {range.setStart(lastTextNode, lastTextNode.textContent?.length || 0);range.collapse(true);if (selection) {selection.removeAllRanges();selection.addRange(range);}} else {range.setStart(element, 0);range.collapse(true);if (selection) {selection.removeAllRanges();selection.addRange(range);}}// 兼容性处理:确保元素获取焦点element.focus();if (document.activeElement !== element) {element.focus();}
};// 计算属性,用于生成渲染内容
const renderedContent = computed(() => {if (!itemConf.value.customConf?.inputHtml) return null;const parts = itemConf.value.customConf.inputHtml.split(/_{1,}/);let nodes: any = [];parts.forEach((part, index) => {if (part) {const replacedSpaces = part.replace(/ /g, '&nbsp;');const replacedPart = replacedSpaces.replace(/<div>/g, '<br>').replace(/<\/div>/g, '');nodes.push(h('span', { class: 'custom-span', innerHTML: replacedPart }));}if (index < parts.length - 1) {if (!inputValues.value[index]) {inputValues.value[index] = '';}if (!isInputFocused.value[index]) {isInputFocused.value[index] = false;}if (!isClearIconClicked.value[index]) {isClearIconClicked.value[index] = false;}if (!clearIconHideTimer.value[index]) {clearIconHideTimer.value[index] = 0;}const clearIcon = h(ElIcon,{class: ['clear_icon',{'is-hidden':inputValues.value[index].length === 0 ||itemConf.value.baseConf.isReadOnly ||!isInputFocused.value[index],},],onClick: () => {if (!itemConf.value.baseConf.isReadOnly) {isClearIconClicked.value[index] = true;inputValues.value[index] = '';if (inputRefs.value[index]) {inputRefs.value[index].innerText = '';}adjustInputWidth(index);handleChange(itemConf.value.customConf.inputGroup[index], '');// 点击后清除隐藏定时器clearTimeout(clearIconHideTimer.value[index]);}},},{ default: () => h(CircleClose) },);const inputNode = h('p',{contenteditable: !itemConf.value.baseConf.isReadOnly,class: ['underline_input',{'is-disabled': itemConf.value.baseConf.isReadOnly,},],disabled: itemConf.value.baseConf.isReadOnly,innerHTML: inputValues.value[index],placeholder: unref(itemConf).customConf?.inputGroup[index]?.placeholder || '请输入',onInput: async (event: InputEvent) => {const target = event.target as HTMLParagraphElement;adjustInputWidth(index);inputValues.value[index] = target.innerHTML;await nextTick(() => {moveCursorToEnd(target);});},onFocus: () => {if (!itemConf.value.baseConf.isReadOnly) {isInputFocused.value[index] = true;clearTimeout(clearIconHideTimer.value[index]);}},onBlur: () => {if (!itemConf.value.baseConf.isReadOnly) {handleChange(itemConf.value.customConf.inputGroup[index], inputValues.value[index]);clearIconHideTimer.value[index] = setTimeout(() => {if (!isClearIconClicked.value[index]) {isInputFocused.value[index] = false;}isClearIconClicked.value[index] = false;}, 200);}},onMousedown: (event: MouseEvent) => {if (itemConf.value.baseConf.isReadOnly) {event.preventDefault();event.stopPropagation();}},onKeydown: (event: KeyboardEvent) => {if (itemConf.value.baseConf.isReadOnly) {event.preventDefault();event.stopPropagation();}},ref: (el) => (inputRefs.value[index] = el),},// [clearIcon],);nodes.push(h('p', { class: 'underline_input_wrap' }, [inputNode, clearIcon]));}});return h('div', nodes);
});

css部分


.underline_input_wrap {display: inline-block;// max-width: calc(100% - 70px);position: relative;margin-top: 20px;margin-bottom: 0;max-width: calc(100% - 50px);
}
.underline_input {position: relative;height: 40px;min-width: 101px;// max-width: calc(100% - 70px);max-width: 100%;background: #f5f7fb;border-radius: 6px 6px 6px 6px;border: none;margin-left: 10px;margin-top: 0;margin-bottom: 0;display: inline-block;box-sizing: border-box;padding: 0 26px 0 12px;background: #f5f7fb;vertical-align: middle;color: #606266;background: #f5f7fb;vertical-align: middle;&:focus {outline: none;border: 1px solid #1a77ff;color: #606266;}&:disabled {color: #bbbfc4;cursor: not-allowed;}&::placeholder {color: #a8abb2;font-size: 14px;}
}.underline_input.is-disabled {color: #bbbfc4;cursor: not-allowed;
}.underline_input[contenteditable='true']:empty::before,
.underline_input.is-disabled:empty::before {content: attr(placeholder);color: #bbbfc4;
}
:deep(.clear_icon) {position: absolute;width: 14px;height: 14px;right: 5px;top: 50%;transform: translateY(-50%);cursor: pointer;color: #999;z-index: 10; /* 增加 z-index 确保在最上层 */&:hover {color: #666;}&.is-hidden {display: none;}
}

我们要模拟input可清除,所以需要我们去调整样式,以及placeholder样式问题


文章转载自:

http://b9PdlB9O.kbwfr.cn
http://7DXPSOcB.kbwfr.cn
http://jtJSyWun.kbwfr.cn
http://wodOcZGM.kbwfr.cn
http://a6Ygahok.kbwfr.cn
http://ABzmmyFK.kbwfr.cn
http://zj8QJC2O.kbwfr.cn
http://Z4CphUCl.kbwfr.cn
http://xOpaFh08.kbwfr.cn
http://uSLhpQRf.kbwfr.cn
http://tT4H5vX1.kbwfr.cn
http://Y1tc2l5h.kbwfr.cn
http://GrAjcrG8.kbwfr.cn
http://o6hQpBDH.kbwfr.cn
http://Ovz9SIBr.kbwfr.cn
http://WqELXiEF.kbwfr.cn
http://jTW8fy5g.kbwfr.cn
http://kjXLkiwp.kbwfr.cn
http://nP9z7yFi.kbwfr.cn
http://4He776qA.kbwfr.cn
http://pFSPfJFv.kbwfr.cn
http://KNeycMbr.kbwfr.cn
http://9T170Umv.kbwfr.cn
http://DskPCufd.kbwfr.cn
http://uLC8Xosz.kbwfr.cn
http://Q9NzuzMO.kbwfr.cn
http://fVXTmt5Z.kbwfr.cn
http://ZvQ1lXY5.kbwfr.cn
http://yjNX61Sg.kbwfr.cn
http://o8z3yDlH.kbwfr.cn
http://www.dtcms.com/wzjs/643885.html

相关文章:

  • 软件开发商网站萍乡网站建设哪家好
  • 常见网站安全漏洞农村做网站赚钱
  • 中国能建平台网页seo优化
  • 怎么免费做一个网站网页升级访问紧急通知
  • 网站内容建设评估网站建设源代码版权问题
  • asp商业网站源码网站服务器 重启
  • 营销型网站建设市场榆林市住房和城市建设局网站
  • 免费自建网站wordpress标题主题
  • 福州公司网站建设一定要用主流程序php语言做推广效果哪个网站好
  • 东莞网站建设外贸招标代理公司注册
  • 建设领域现场专业人员报名网站网站开发算软件开发吗
  • 网站建设视频教程 百度云中国建设网站培训通知
  • 做网站开发的过程摄影作品欣赏网站推荐
  • 什么是门户网站线上宣传方式有哪些
  • 临沂供电公司网站asp网站模版安装
  • 常州网站建设团队企业网站策划大纲模板
  • 网站一年得多少钱wordpress中英文版如何
  • 做网站必须搭框架么家居企业网站建设流程
  • 网站seo优化综合服务公司哪家好高明区住房和城乡建设局网站
  • 网站模版可以套用吗大连百度搜索排名
  • 室内装潢网站的排名优化怎么做
  • 翻译网站平台建设教育局网站建设方案
  • 网站301和302做网站栏目是什么意思
  • 唐山制作网站的公司wordpress 云相册
  • 专业门户网站建设网站推广的案例
  • 搜索引擎推广网站青岛网站建设选圣城
  • 企业网站建设珠海吉林珠海网站建设
  • 室内装修设计网站推荐网站建设怎么在png上写文字
  • 雅虎提交网站入口仙游住房与城乡建设局网站
  • 南宁网站建设-中国互联如何用wordpress做企业