Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liangzhen
/
framework-tools-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0297ff6a
authored
Feb 28, 2024
by
xiehao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、修改了架构元模型结构化解析地址
1 parent
a332481d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
src/directive/index.js
vue.config.js
src/directive/index.js
View file @
0297ff6
...
...
@@ -25,27 +25,27 @@ export default function initDirective(vue) {
}
})
//
vue.directive('no-backslash', {
//
// bind 钩子函数会在指令绑定到元素时调用
//
bind(el, binding, vnode) {
//
// 绑定 @input 监听方法
//
el.addEventListener('input', function (event) {
//
// 获取输入的值
//
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;
//
// 如果输入值包含特殊字符,则替换为空格
//
if (regex.test(value)) {
//
// 使用 replace 方法替换特殊字为空格
//
const newValue = value.replace(regex, ' ');
//
// 将新值设置回输入框
//
event.target.value = newValue;
//
// 触发 @input 事件,使其更新组件中的数据
//
vnode.componentInstance.$emit('input', newValue);
//
}
//
});
//
},
//
});
vue
.
directive
(
'no-backslash'
,
{
// bind 钩子函数会在指令绑定到元素时调用
bind
(
el
,
binding
,
vnode
)
{
// 绑定 @input 监听方法
el
.
addEventListener
(
'input'
,
function
(
event
)
{
// 获取输入的值
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
;
// 如果输入值包含特殊字符,则替换为空格
if
(
regex
.
test
(
value
))
{
// 使用 replace 方法替换特殊字为空格
const
newValue
=
value
.
replace
(
regex
,
' '
);
// 将新值设置回输入框
event
.
target
.
value
=
newValue
;
// 触发 @input 事件,使其更新组件中的数据
vnode
.
componentInstance
.
$emit
(
'input'
,
newValue
);
}
});
},
});
}
vue.config.js
View file @
0297ff6
const
{
defineConfig
}
=
require
(
'@vue/cli-service'
);
const
ip
=
'
127.0.0.1
'
;
const
ip
=
'
43.143.211.42
'
;
module
.
exports
=
defineConfig
({
transpileDependencies
:
true
,
//如果是hash模式, publicPath:"";如果是history, publicPath:"/"
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment