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

wordpress主题proland/关键词优化的发展趋势

wordpress主题proland,关键词优化的发展趋势,如何评判一个网站建设的怎么样,目前做哪个网站能致富第一次使用官方的uni-numbox,把step设置成小数点,才可以输入小数点。 嗯~~。还是饿了么ElInputNumber组件好用。copy改造了下添加precision控制,小数点就ok了。 template、style不变。其他更多功能去饿了么添加 export default {name: "…

第一次使用官方的uni-numbox,把step设置成小数点,才可以输入小数点。 嗯~~。还是饿了么ElInputNumber组件好用。copy改造了下添加precision控制,小数点就ok了。

template、style不变。其他更多功能去饿了么添加

	export default {name: "UniNumberBox",emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],props: {value: {type: [Number, String],default: 1},modelValue: {type: [Number, String],default: 1},min: {type: Number,default: 0},max: {type: Number,default: 100},step: {type: Number,default: 1},background: {type: String,default: '#f5f5f5'},color: {type: String,default: '#333'},disabled: {type: Boolean,default: false},// 精度precision: {type: Number,default: 4,validator(val) {return val >= 0 && val === parseInt(val, 10);}}},data() {return {inputValue: 0};},watch: {value(val) {this.inputValue = +val;},modelValue(val) {this.inputValue = +val;}},computed:{numPrecision() {const { value, step, getPrecision, precision } = this;const stepPrecision = getPrecision(step);if (precision !== undefined) {if (stepPrecision > precision) {// 精度不应小于步长的小数点  console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');}return precision;} else {return Math.max(getPrecision(value), stepPrecision);}},},created() {if (this.value === 1) {this.inputValue = +this.modelValue;}if (this.modelValue === 1) {this.inputValue = +this.value;}},methods: {getPrecision(value) {if (value === undefined) return 0;const valueString = value.toString();const dotPosition = valueString.indexOf('.');let precision = 0;if (dotPosition !== -1) {precision = valueString.length - dotPosition - 1;}return precision;},toPrecision(num, precision) {if (precision === undefined) precision = this.numPrecision;return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));},_increase(val, step) {if (typeof val !== 'number' && val !== undefined) return this.currentValue;const precisionFactor = Math.pow(10, this.numPrecision);// Solve the accuracy problem of JS decimal calculation by converting the value to integer.return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);},_decrease(val, step) {if (typeof val !== 'number' && val !== undefined) return this.inputValue;const precisionFactor = Math.pow(10, this.numPrecision);return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);},setCurrentValue(newVal) {const oldVal = this.value;if (typeof newVal === 'number' && this.precision !== undefined) {newVal = this.toPrecision(newVal, this.precision);}if (newVal >= this.max) newVal = this.max;if (newVal <= this.min) newVal = this.min;if (oldVal === newVal) return this.value;this.$emit("change", newVal);// TODO vue2 兼容this.$emit("input", newVal);// TODO vue3 兼容this.$emit("update:modelValue", newVal);this.inputValue = newVal;},_calcValue(type) {if (this.disabled) {return;}if (type === "minus") {this.decrease()}if (type === "plus") {this.increase()}},increase() {// if (this.inputNumberDisabled || this.maxDisabled) return;const value = this.value || 0;const newVal = this._increase(value, this.step);this.setCurrentValue(newVal);},decrease() {// if (this.inputNumberDisabled || this.minDisabled) return;const value = this.value || 0;const newVal = this._decrease(value, this.step);this.setCurrentValue(newVal);},_onBlur(event) {this.$emit('blur', event)let value = event.detail.value;if (!value) {// this.inputValue = 0;return;}this.inputValue = this.setCurrentValue(this.toPrecision(value, this.precision));},_onFocus(event) {this.$emit('focus', event)}}};
http://www.jmfq.cn/news/5264893.html

相关文章:

  • 珠宝首饰商城网站建设/优化大师的三大功能
  • 网站后台排版布局/优化网哪个牌子好
  • 品牌开发公司排名/知了seo
  • 做网站找谁/竞价推广账户竞价托管公司
  • 北京智能网站建设平台/手机百度搜索引擎
  • 电子政务网站建设总结/新闻发稿渠道
  • 上海有多少家网站建设公司/电子商务营销方法
  • 做网站最流行的语言/搜索关键词排名推广
  • 小说网站seo排名怎么做/广州网站seo推广
  • 动态电商网站怎么做/如何做网站推广广告
  • 房产网站怎么建设/百度搜索推广开户
  • 做团购网站的公司/网站的网络推广
  • 惠州网站设计培训/小程序平台
  • 建站网站推荐/外链网址
  • 旅游网站 div css 模板下载/搜索百度
  • 加强主流新闻网站建设/爱站小工具计算器
  • 前程无忧做简历网站/公司域名查询官网
  • 自己做网站 怎么解决安全问题/免费建站的平台
  • 微云做网站/全网整合营销平台
  • 朝阳网站建设是什么/网页平台做个业务推广
  • 优质网站建设报价/百度合伙人答题兼职赚钱
  • 房地产网站建设方案书/一句话宣传自己的产品
  • 做阿里巴巴网站需要多少钱/兰州网络优化seo
  • 寻找网站开发/电商培训大概多少学费
  • 一般门户网站/搜索引擎网址有哪些
  • 免费简历制作软件app/朝阳seo推广
  • 南昌网站建设在哪里/今晚赛事比分预测
  • 领券购买网站是怎么做的/百度推广官方
  • 海淀网站制作/网络推广运营优化
  • 黑龙江省中国建设银行网站首页/网站运营方案