MCPcopy Create free account
hub / github.com/ygs-code/vue / validateComponentName

Function validateComponentName

vue.js:1974–1988  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

1972
1973 //验证组件名称 必须是大小写,并且是-横杆
1974 function validateComponentName(name) {
1975 if (!/^[a-zA-Z][\w-]*$/.test(name)) {
1976 warn(
1977 'Invalid component name: "' + name + '". Component names ' +
1978 'can only contain alphanumeric characters and the hyphen, ' +
1979 'and must start with a letter.'
1980 );
1981 }
1982 if (isBuiltInTag(name) || config.isReservedTag(name)) {
1983 warn(
1984 'Do not use built-in or reserved HTML elements as component ' +
1985 'id: ' + name
1986 );
1987 }
1988 }
1989
1990 /**
1991 * Ensure all props option syntax are normalized into the

Callers 3

checkComponentsFunction · 0.85
initExtendFunction · 0.85
initAssetRegistersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected