Explorar el Código

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

zuohuaijun hace 3 años
padre
commit
343c3e202f
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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;
 			});
 		};
 		// 监听页面宽度改变