Преглед на файлове

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

zuohuaijun преди 4 години
родител
ревизия
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 的宽度
 		const getInputWidth = () => {
 			nextTick(() => {
-				state.fontIconWidth = inputWidthRef.value.$el.offsetWidth;
+				state.fontIconWidth = inputWidthRef.value?.$el.offsetWidth;
 			});
 		};
 		// 监听页面宽度改变