Commit 72a9cef6 by xiehao

1、修改了架构元模型结构化解析地址

1 parent a94d6da7
Showing with 22 additions and 22 deletions
...@@ -25,27 +25,27 @@ export default function initDirective(vue) { ...@@ -25,27 +25,27 @@ export default function initDirective(vue) {
} }
}) })
vue.directive('no-backslash', { // vue.directive('no-backslash', {
// bind 钩子函数会在指令绑定到元素时调用 // // bind 钩子函数会在指令绑定到元素时调用
bind(el, binding, vnode) { // bind(el, binding, vnode) {
// 绑定 @input 监听方法 // // 绑定 @input 监听方法
el.addEventListener('input', function (event) { // el.addEventListener('input', function (event) {
// 获取输入的值 // // 获取输入的值
const value = event.target.value; // const value = event.target.value;
//
// 使用正则表达式检测特殊字(根据需要匹配相应限制字符) // // 使用正则表达式检测特殊字(根据需要匹配相应限制字符)
const regex = /(?:')|(?:-- )|(\/\*(?:.|[\n\r])*?\*\/)|(\b(select|update|and|or|delete|insert|truncate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute)\b)/i; // const regex = /(?:')|(?:-- )|(\/\*(?:.|[\n\r])*?\*\/)|(\b(select|update|and|or|delete|insert|truncate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute)\b)/i;
// 如果输入值包含特殊字符,则替换为空格 // // 如果输入值包含特殊字符,则替换为空格
if (regex.test(value)) { // if (regex.test(value)) {
// 使用 replace 方法替换特殊字为空格 // // 使用 replace 方法替换特殊字为空格
const newValue = value.replace(regex, ' '); // const newValue = value.replace(regex, ' ');
// 将新值设置回输入框 // // 将新值设置回输入框
event.target.value = newValue; // event.target.value = newValue;
// 触发 @input 事件,使其更新组件中的数据 // // 触发 @input 事件,使其更新组件中的数据
vnode.componentInstance.$emit('input', newValue); // vnode.componentInstance.$emit('input', newValue);
} // }
}); // });
}, // },
}); // });
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!