fix: Vue2 到 Vue3 迁移兼容修复
- 修复 uni-popup-dialog/uni-data-picker keypress.js 中 $once 在 H5 端报错(改用生命周期钩子清理监听) - main.js 补 $delete globalProperties polyfill(z-paging 自动高度逻辑依赖) - App.vue onLaunch 补设备信息初始化,修复 X-Device-Id 恒为 unknown - 68 处 ::v-deep、/deep/ 旧深度选择器替换为 :deep()(含 login-page.scss) - zetank-personalpage 组件 .sync 修饰符改为 v-model:xxx(Vue3 已移除 .sync) - vite.config.js HBuilderX 路径支持 HBUILDERX_HOME 环境变量覆盖 - 根 package.json 清理 image-grid 插件遗留元数据 - 收录此前未提交的 uView Vue3 兜底补丁(common/uview-init.js 及各组件 props.js)
This commit is contained in:
@@ -1,184 +1,185 @@
|
||||
import '@/common/uview-init.js'
|
||||
export default {
|
||||
props: {
|
||||
// 输入的值
|
||||
// 杈撳叆鐨勫€?
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.value
|
||||
},
|
||||
// 输入框类型
|
||||
// number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
|
||||
// idcard-身份证输入键盘,微信、支付宝、百度、QQ小程序
|
||||
// digit-带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序
|
||||
// text-文本输入键盘
|
||||
// 杈撳叆妗嗙被鍨?
|
||||
// number-鏁板瓧杈撳叆閿洏锛宎pp-vue涓嬪彲浠ヨ緭鍏ユ诞鐐规暟锛宎pp-nvue鍜屽皬绋嬪簭骞冲彴涓嬪彧鑳借緭鍏ユ暣鏁?
|
||||
// idcard-韬唤璇佽緭鍏ラ敭鐩橈紝寰俊銆佹敮浠樺疂銆佺櫨搴︺€丵Q灏忕▼搴?
|
||||
// digit-甯﹀皬鏁扮偣鐨勬暟瀛楅敭鐩橈紝App鐨刵vue椤甸潰銆佸井淇°€佹敮浠樺疂銆佺櫨搴︺€佸ご鏉°€丵Q灏忕▼搴?
|
||||
// text-鏂囨湰杈撳叆閿洏
|
||||
type: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.type
|
||||
},
|
||||
// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
|
||||
// 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
|
||||
// 濡傛灉 textarea 鏄湪涓€涓?position:fixed 鐨勫尯鍩燂紝闇€瑕佹樉绀烘寚瀹氬睘鎬?fixed 涓?true锛?
|
||||
// 鍏煎鎬э細寰俊灏忕▼搴忋€佺櫨搴﹀皬绋嬪簭銆佸瓧鑺傝烦鍔ㄥ皬绋嬪簭銆丵Q灏忕▼搴?
|
||||
fixed: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.fixed
|
||||
},
|
||||
// 是否禁用输入框
|
||||
// 鏄惁绂佺敤杈撳叆妗?
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.disabled
|
||||
},
|
||||
// 禁用状态时的背景色
|
||||
// 绂佺敤鐘舵€佹椂鐨勮儗鏅壊
|
||||
disabledColor: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.disabledColor
|
||||
},
|
||||
// 是否显示清除控件
|
||||
// 鏄惁鏄剧ず娓呴櫎鎺т欢
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.clearable
|
||||
},
|
||||
// 是否密码类型
|
||||
// 鏄惁瀵嗙爜绫诲瀷
|
||||
password: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.password
|
||||
},
|
||||
// 最大输入长度,设置为 -1 的时候不限制最大长度
|
||||
// 鏈€澶ц緭鍏ラ暱搴︼紝璁剧疆涓?-1 鐨勬椂鍊欎笉闄愬埗鏈€澶ч暱搴?
|
||||
maxlength: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.maxlength
|
||||
},
|
||||
// 输入框为空时的占位符
|
||||
// 杈撳叆妗嗕负绌烘椂鐨勫崰浣嶇
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.placeholder
|
||||
},
|
||||
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
|
||||
// 鎸囧畾placeholder鐨勬牱寮忕被锛屾敞鎰忛〉闈㈡垨缁勪欢鐨剆tyle涓啓浜唖coped鏃讹紝闇€瑕佸湪绫诲悕鍓嶅啓/deep/
|
||||
placeholderClass: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.placeholderClass
|
||||
},
|
||||
// 指定placeholder的样式
|
||||
// 鎸囧畾placeholder鐨勬牱寮?
|
||||
placeholderStyle: {
|
||||
type: [String, Object],
|
||||
default: uni.$u.props.input.placeholderStyle
|
||||
},
|
||||
// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
|
||||
// 鏄惁鏄剧ず杈撳叆瀛楁暟缁熻锛屽彧鍦?type ="text"鎴杢ype ="textarea"鏃舵湁鏁?
|
||||
showWordLimit: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.showWordLimit
|
||||
},
|
||||
// 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
|
||||
// 璁剧疆鍙充笅瑙掓寜閽殑鏂囧瓧锛屾湁鏁堝€硷細send|search|next|go|done锛屽吋瀹规€ц瑙乽ni-app鏂囨。
|
||||
// https://uniapp.dcloud.io/component/input
|
||||
// https://uniapp.dcloud.io/component/textarea
|
||||
confirmType: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.confirmType
|
||||
},
|
||||
// 点击键盘右下角按钮时是否保持键盘不收起,H5无效
|
||||
// 鐐瑰嚮閿洏鍙充笅瑙掓寜閽椂鏄惁淇濇寔閿洏涓嶆敹璧凤紝H5鏃犳晥
|
||||
confirmHold: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.confirmHold
|
||||
},
|
||||
// focus时,点击页面的时候不收起键盘,微信小程序有效
|
||||
// focus鏃讹紝鐐瑰嚮椤甸潰鐨勬椂鍊欎笉鏀惰捣閿洏锛屽井淇″皬绋嬪簭鏈夋晥
|
||||
holdKeyboard: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.holdKeyboard
|
||||
},
|
||||
// 自动获取焦点
|
||||
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
|
||||
// 鑷姩鑾峰彇鐒︾偣
|
||||
// 鍦?H5 骞冲彴鑳藉惁鑱氱劍浠ュ強杞敭鐩樻槸鍚﹁窡闅忓脊鍑猴紝鍙栧喅浜庡綋鍓嶆祻瑙堝櫒鏈韩鐨勫疄鐜般€俷vue 椤甸潰涓嶆敮鎸侊紝闇€浣跨敤缁勪欢鐨?focus()銆乥lur() 鏂规硶鎺у埗鐒︾偣
|
||||
focus: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.focus
|
||||
},
|
||||
// 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
|
||||
// 閿洏鏀惰捣鏃讹紝鏄惁鑷姩澶卞幓鐒︾偣锛岀洰鍓嶄粎App3.0.0+鏈夋晥
|
||||
autoBlur: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.autoBlur
|
||||
},
|
||||
// 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
|
||||
// 鏄惁鍘绘帀 iOS 涓嬬殑榛樿鍐呰竟璺濓紝浠呭井淇″皬绋嬪簭锛屼笖type=textarea鏃舵湁鏁?
|
||||
disableDefaultPadding: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.disableDefaultPadding
|
||||
},
|
||||
// 指定focus时光标的位置
|
||||
// 鎸囧畾focus鏃跺厜鏍囩殑浣嶇疆
|
||||
cursor: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.cursor
|
||||
},
|
||||
// 输入框聚焦时底部与键盘的距离
|
||||
// 杈撳叆妗嗚仛鐒︽椂搴曢儴涓庨敭鐩樼殑璺濈
|
||||
cursorSpacing: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.cursorSpacing
|
||||
},
|
||||
// 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
||||
// 鍏夋爣璧峰浣嶇疆锛岃嚜鍔ㄨ仛闆嗘椂鏈夋晥锛岄渶涓巗election-end鎼厤浣跨敤
|
||||
selectionStart: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.selectionStart
|
||||
},
|
||||
// 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
||||
// 鍏夋爣缁撴潫浣嶇疆锛岃嚜鍔ㄨ仛闆嗘椂鏈夋晥锛岄渶涓巗election-start鎼厤浣跨敤
|
||||
selectionEnd: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.selectionEnd
|
||||
},
|
||||
// 键盘弹起时,是否自动上推页面
|
||||
// 閿洏寮硅捣鏃讹紝鏄惁鑷姩涓婃帹椤甸潰
|
||||
adjustPosition: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.adjustPosition
|
||||
},
|
||||
// 输入框内容对齐方式,可选值为:left|center|right
|
||||
// 杈撳叆妗嗗唴瀹瑰榻愭柟寮忥紝鍙€夊€间负锛歭eft|center|right
|
||||
inputAlign: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.inputAlign
|
||||
},
|
||||
// 输入框字体的大小
|
||||
// 杈撳叆妗嗗瓧浣撶殑澶у皬
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.input.fontSize
|
||||
},
|
||||
// 输入框字体颜色
|
||||
// 杈撳叆妗嗗瓧浣撻鑹?
|
||||
color: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.color
|
||||
},
|
||||
// 输入框前置图标
|
||||
// 杈撳叆妗嗗墠缃浘鏍?
|
||||
prefixIcon: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.prefixIcon
|
||||
},
|
||||
// 前置图标样式,对象或字符串
|
||||
// 鍓嶇疆鍥炬爣鏍峰紡锛屽璞℃垨瀛楃涓?
|
||||
prefixIconStyle: {
|
||||
type: [String, Object],
|
||||
default: uni.$u.props.input.prefixIconStyle
|
||||
},
|
||||
// 输入框后置图标
|
||||
// 杈撳叆妗嗗悗缃浘鏍?
|
||||
suffixIcon: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.suffixIcon
|
||||
},
|
||||
// 后置图标样式,对象或字符串
|
||||
// 鍚庣疆鍥炬爣鏍峰紡锛屽璞℃垨瀛楃涓?
|
||||
suffixIconStyle: {
|
||||
type: [String, Object],
|
||||
default: uni.$u.props.input.suffixIconStyle
|
||||
},
|
||||
// 边框类型,surround-四周边框,bottom-底部边框,none-无边框
|
||||
// 杈规绫诲瀷锛宻urround-鍥涘懆杈规锛宐ottom-搴曢儴杈规锛宯one-鏃犺竟妗?
|
||||
border: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.border
|
||||
},
|
||||
// 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
|
||||
// 鏄惁鍙锛屼笌disabled涓嶅悓涔嬪鍦ㄤ簬disabled浼氱疆鐏扮粍浠讹紝鑰宺eadonly鍒欎笉浼?
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.input.readonly
|
||||
},
|
||||
// 输入框形状,circle-圆形,square-方形
|
||||
// 杈撳叆妗嗗舰鐘讹紝circle-鍦嗗舰锛宻quare-鏂瑰舰
|
||||
shape: {
|
||||
type: String,
|
||||
default: uni.$u.props.input.shape
|
||||
},
|
||||
// 用于处理或者过滤输入框内容的方法
|
||||
// 鐢ㄤ簬澶勭悊鎴栬€呰繃婊よ緭鍏ユ鍐呭鐨勬柟娉?
|
||||
formatter: {
|
||||
type: [Function, null],
|
||||
default: uni.$u.props.input.formatter
|
||||
},
|
||||
// 是否忽略组件内对文本合成系统事件的处理
|
||||
// 鏄惁蹇界暐缁勪欢鍐呭鏂囨湰鍚堟垚绯荤粺浜嬩欢鐨勫鐞?
|
||||
ignoreCompositionEvent: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
|
||||
Reference in New Issue
Block a user