教师端1期问题修复

This commit is contained in:
赵依梦
2025-12-14 18:22:48 +08:00
committed by joshen
parent f4c73c927b
commit 78fce14500
2 changed files with 186 additions and 65 deletions

View File

@@ -19,6 +19,24 @@ Vue.use(vueKatexEs,{
}
})
Vue.directive('limit-input', {
bind: function (el, binding) {
const max = binding.value || 50;
// 找到input元素
const input = el.querySelector('input');
if (input) {
// 监听input事件在输入时限制长度
input.addEventListener('input', function () {
if (input.value.length > max) {
input.value = input.value.substring(0, max);
// 触发input事件让element-ui的内部处理更新
input.dispatchEvent(new Event('input', { bubbles: true }));
}
});
}
}
});
//import './mock/index'
import xpage from '@/utils/xpage'