فهرست منبع

修复组件iconSelector页面大小改变时计算错误

zuohuaijun 3 سال پیش
والد
کامیت
343c3e202f
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      vue-next-admin/src/components/iconSelector/index.vue

+ 1 - 1
vue-next-admin/src/components/iconSelector/index.vue

@@ -165,7 +165,7 @@ export default defineComponent({
 		// 获取 input 的宽度
 		// 获取 input 的宽度
 		const getInputWidth = () => {
 		const getInputWidth = () => {
 			nextTick(() => {
 			nextTick(() => {
-				state.fontIconWidth = inputWidthRef.value.$el.offsetWidth;
+				state.fontIconWidth = inputWidthRef.value?.$el.offsetWidth;
 			});
 			});
 		};
 		};
 		// 监听页面宽度改变
 		// 监听页面宽度改变