Skip to content

Commit a92e373

Browse files
committed
styling and syntax fixes
1 parent 14f5c04 commit a92e373

File tree

9 files changed

+294
-297
lines changed

9 files changed

+294
-297
lines changed

src/components/CreateComponent.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import Icons from './Icons'
3939
import ParentMultiselect from '../components/ParentMultiselect'
4040
import { mapState, mapActions } from 'vuex'
4141
42-
4342
export default {
4443
name: 'HomeSidebar',
4544
components: {
@@ -68,9 +67,9 @@ export default {
6867
'addNestedNoActive'
6968
]),
7069
handleClick () {
71-
if (!this.componentNameInputValue.trim()) {
72-
event.preventDefault();
73-
return false;
70+
if (!this.componentNameInputValue.replace(/[^a-z0-9-_.]/gi, '')) {
71+
event.preventDefault()
72+
return false
7473
}
7574
const component = {
7675
componentName: this.componentNameInputValue.replace(/[^a-z0-9-_.]/gi, ''),
@@ -86,12 +85,11 @@ export default {
8685
}
8786
8887
this.registerComponent(component)
89-
9088
},
9189
resetActiveComponent () {
9290
if (this.activeComponent !== '') {
9391
this.setActiveComponent('')
94-
}
92+
}
9593
},
9694
handleIconClick () {
9795
if (this.activeComponent === '') this.setClickedElementList()

0 commit comments

Comments
 (0)