fix more linting errors
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="demo__meta">
|
||||
<div class="demo__name">
|
||||
Demo/{{ this.name }}
|
||||
Demo/{{ name }}
|
||||
</div>
|
||||
<a class="demo__link" :href="githubUrl" target="_blank">
|
||||
Edit on GitHub →
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="demo__error">
|
||||
Could not find a demo called “{{ this.name }}”.
|
||||
Could not find a demo called “{{ name }}”.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
hideSourceCode: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -106,7 +106,7 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.files = collect(require.context(`~/demos/`, true, /.+\..+$/).keys())
|
||||
this.files = collect(require.context('~/demos/', true, /.+\..+$/).keys())
|
||||
.filter(path => path.startsWith(`./${this.name}`))
|
||||
.map(path => path.replace('./', ''))
|
||||
.map(path => {
|
||||
@@ -120,13 +120,13 @@ export default {
|
||||
highlight: this.syntax[extension] || extension,
|
||||
}
|
||||
})
|
||||
.filter((item) => {
|
||||
.filter(item => {
|
||||
return ['vue', 'jsx', 'scss'].includes(item.extension)
|
||||
})
|
||||
.sortBy(item => item.path.split('/').length)
|
||||
.toArray()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="./style.scss" scoped />
|
||||
<style lang="scss" src="./style.scss" scoped />
|
||||
|
||||
@@ -51,8 +51,8 @@ export default {
|
||||
previousPage() {
|
||||
return this.items[this.currentIndex - 1]
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="./style.scss" scoped></style>
|
||||
<style lang="scss" src="./style.scss" scoped></style>
|
||||
|
||||
@@ -34,11 +34,11 @@ export default {
|
||||
methods: {
|
||||
highlightCode() {
|
||||
Prism.highlightAllUnder(this.$el)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.highlightCode()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
props: {
|
||||
component: {
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -21,4 +21,4 @@ export default {
|
||||
ReactDOM.unmountComponentAtNode(this.$el)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -8,18 +8,18 @@ import { outdent } from '@mvasilkov/outdent'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formattedCode: null
|
||||
formattedCode: null,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
updateCode() {
|
||||
const text = this.$slots.default[0].text
|
||||
const { text } = this.$slots.default[0]
|
||||
|
||||
if (text) {
|
||||
this.formattedCode = outdent(text)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
beforeUpdate() {
|
||||
@@ -30,4 +30,4 @@ export default {
|
||||
this.updateCode()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user