mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix javascript runtime errors
I could see a warning about duplicate keys on the `Chip` page, also there seems to be a missing check if a param is null (I used a default).
This commit is contained in:
parent
3d41d811d2
commit
79a8fc5f5f
@ -202,7 +202,7 @@ export default {
|
||||
}
|
||||
return attributes
|
||||
},
|
||||
getAttributesFromComment(comment) {
|
||||
getAttributesFromComment(comment = '') {
|
||||
const attributes = {}
|
||||
const optionsMatch = comment.match(/@options[ ]+(\S[ \S]*)\n/)
|
||||
if (optionsMatch) {
|
||||
|
||||
@ -32,16 +32,9 @@ A chip can be deletable.
|
||||
v-for="(tag, index) in tags"
|
||||
@remove="removeTag(index)"
|
||||
removable
|
||||
:key="tag">
|
||||
{{ tag }}
|
||||
</ds-chip>
|
||||
<ds-chip
|
||||
v-for="(tag, index) in tags"
|
||||
@remove="removeTag(index)"
|
||||
removable
|
||||
color="primary"
|
||||
:key="tag">
|
||||
{{ tag }}
|
||||
:key="index"
|
||||
:color="tag.color">
|
||||
{{ tag.label }}
|
||||
</ds-chip>
|
||||
</div>
|
||||
</template>
|
||||
@ -49,7 +42,14 @@ A chip can be deletable.
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tags: ['Dog', 'Cat', 'Duck']
|
||||
tags: [
|
||||
{label: 'Dog'},
|
||||
{label: 'Cat'},
|
||||
{label: 'Duck'},
|
||||
{label: 'Mouse', color: "primary"},
|
||||
{label: 'Bird', color: "primary"},
|
||||
{label: 'Elephant', color: "primary"},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user