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

天天网站合肥专业网站制

天天网站,合肥专业网站制,企业做网站需要在通管局备案,东莞网站建设信科核心原理 当 input 输入#xff0c;存在一个 view 元素容纳输入内容#xff0c;此时获取 view 元素的宽#xff0c;将其设置为 input 的宽 特殊情况#xff1a;回显的时候当前元素可能不存在#xff0c;此时需要借助一个永远显示的元素进行宽度计算#xff08;InputWidt…核心原理 当 input 输入存在一个 view 元素容纳输入内容此时获取 view 元素的宽将其设置为 input 的宽 特殊情况回显的时候当前元素可能不存在此时需要借助一个永远显示的元素进行宽度计算InputWidthHelper.vue adaption-input.vue templateview classadaption-input-wrapperview classadaption-inputinputtypetext:placeholder-styleplaceholderStyle:placeholderplaceholder:style{ width: inputWidth }inputchangeInputFn//viewview :idrandomID classa--input{{ modelValue || 请输入 }}/view/view /templatescriptexport default {inheritAttrs: false,props: {modelValue: {type: [String, Number],default: ,},placeholder: {type: String,default: 请输入,},placeholderStyle: {type: String,default: color: #9ea5bb,},},data() {return {randomID: adaption_ new Date().getTime(),inputWidth: ,}},watch: {modelValue: {handler() {this.$nextTick(() {this.changeInputFn()})},immediate: true,},},options: {virtualHost: true,},computed: {inputVal: {set(val) {this.$emit(update:modelValue, val)this.$emit(change, val)},get() {return this.modelValue},},},methods: {changeInputFn() {setTimeout(() {const query uni.createSelectorQuery().in(this)query.select(#${this.randomID}).boundingClientRect((rect) {if (rect) {// 处于不可见状态需要借助一个永远显示的 dom 进行处理if (rect.width 0) {uni.$emit(getInputWidth, this.inputVal)} else {let rectWidth rect.widthif (rectWidth 150) {rectWidth 150}if (this.inputVal) {this.inputWidth rectWidth 30 px} else {this.inputWidth rectWidth 5 px}}}}).exec()}, 0)},},mounted() {uni.$on(returnInputWidth, (width) {this.inputWidth width})},} /scriptstyle langscss scoped.adaption-input {font-size: 28rpx;}.a--input {font: inherit;opacity: 0;position: fixed;top: 0;z-index: -1;} /style InputWidthHelper.vue templateview :idrandomID classa--input{{ inputValue || 请输入 }}/view /templatescriptexport default {inheritAttrs: false,data() {return {randomID: adaption_ new Date().getTime(),inputValue: ,}},mounted() {uni.$on(getInputWidth, (text) {this.inputValue textthis.$nextTick(() {const query uni.createSelectorQuery().in(this)query.select(#${this.randomID}).boundingClientRect((rect) {if (rect) {let rectWidth rect.widthif (rectWidth 150) {rectWidth 150}if (text) {uni.$emit(returnInputWidth, rectWidth 30 px)} else {uni.$emit(returnInputWidth, rectWidth 5 px)}}}).exec()})})},} /scriptstyle langscss scoped.adaption-input {font-size: 28rpx;}.a--input {font: inherit;opacity: 0;position: fixed;top: 0;z-index: -1;} /style
http://www.sadfv.cn/news/240949/

相关文章:

  • 湖北营销型网站建设价格宁波男科医院哪家比较好
  • 中国信用网站建设的重要性上海排名十大装潢公司
  • 梧州做网站建设ip138域名网址查询
  • 做网站所需的知识技能自助个人网站注册
  • win7用本地文件做网站模板好看到让人久久不忘的电影
  • 有哪些网站可以做海报设计知乎ps个人网站设计总结
  • 网站开发服务流程宝安网站建设公司
  • 企业网站建设哪家服务好参与网站网站建设可判几年
  • 昌大建设和天元大连网站推广优化
  • 建站行业有哪些公司海天建设集团公司网站
  • 重庆响应式网站平台网上接做网站的单子
  • 网站过期查询免费网站建设模板
  • 象山建设局网站网站开发标准
  • 网站建设合同协议网站运行维护
  • 织梦中英网站怎么做网站经营性备案需要什么资料
  • 专门做汽车配件的外贸网站建网站要多少钱一个
  • 新手怎样学校做网站做盗版频网站
  • 泰安诚信的网站建设vps搭建网站是什么意思
  • 网站建设实训意见和建议嘉峪关市建设局网站
  • 在吗做网站商城学校网站模板 dede
  • 南昌免费做网站建设跨境网站
  • 擦边球做网站挣钱跨境电商是怎么赚钱的
  • 创新的企业网站制作牌匾设计一键生成
  • 网页建设技术和网站策划书男女做的羞羞事的网站
  • 杭州 高端网站 开发网站建设的作业模板
  • 沈阳做网站的公司排名网站建设流
  • 好医生网站怎么做不了题目了公司查询企业查询在线
  • 网站建设与网站制作广州seo优化公司排名
  • 做网站鼎盛注册安全工程师科目
  • 网站二维码链接怎么做的wordpress404模板