mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 13:11:30 +08:00

* feat: support solidity in codeblock and optimization of file icons * feat: update file icons
35 lines
635 B
Vue
35 lines
635 B
Vue
<template>
|
|
<span :class="className" class="file-icon"></span>
|
|
</template>
|
|
|
|
<script>
|
|
import fileIcons from 'muya/lib/ui/fileIcons'
|
|
|
|
export default {
|
|
props: {
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
default: 'mock.md'
|
|
}
|
|
},
|
|
computed: {
|
|
className () {
|
|
let icon = fileIcons.getClassByName(this.name ? this.name : 'mock.md')
|
|
if (!icon) {
|
|
// Use fallback icon when the icon is unknown.
|
|
icon = fileIcons.getClassByName('mock.md')
|
|
}
|
|
return icon.split(/\s/)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.file-icon {
|
|
flex-shrink: 0;
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|