feat: 为代码编辑插件增加了更多的语言支持,修复了一些bug,样式还没写。
This commit is contained in:
1 parent
86b3a02237
commit
ef5a8f1a9e
7 files changed
+275
-18
No files matched your search
+19
-3
@@ -1,4 +1,4 @@
|
||||
// import MiaoDirectory from '@/views/miaoDirectory.vue'
|
||||
import MiaoDirectory from '@/views/miaoDirectory.vue'
|
||||
import usePluginCenter from './usePluginCenter'
|
||||
|
||||
export default function init() {
|
||||
@@ -6,7 +6,7 @@ export default function init() {
|
||||
pluginCenter.registerComponent(
|
||||
'miaoDirectory',
|
||||
'文件夹',
|
||||
async() => (await import('@/views/miaoDirectory.vue')).default,
|
||||
async () => MiaoDirectory,
|
||||
(vDirs, vFiles) => {
|
||||
if (vFiles.length) {
|
||||
return false
|
||||
@@ -74,7 +74,23 @@ export default function init() {
|
||||
if (vFiles.length !== 1) {
|
||||
return false
|
||||
}
|
||||
for (let end of ['js', 'ts', 'py', 'html', 'css']) {
|
||||
for (let end of [
|
||||
'js',
|
||||
'ts',
|
||||
'jsx',
|
||||
'tsx',
|
||||
'py',
|
||||
'html',
|
||||
'css',
|
||||
'scss',
|
||||
'go',
|
||||
'json',
|
||||
'md',
|
||||
'yaml',
|
||||
'txt',
|
||||
'xml',
|
||||
'vue',
|
||||
]) {
|
||||
if (vFiles[0].name.endsWith(end)) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -77,12 +77,13 @@ const miaoFetchApi = {
|
||||
// const { baseUrl, api } = Config
|
||||
const url = vFile.url
|
||||
const retry = option?.retry ?? 0
|
||||
const axiosOption = option?.axiosOption ?? {}
|
||||
|
||||
const { miaoFetch } = useMiaoFetch({
|
||||
retry
|
||||
})
|
||||
const response = await miaoFetch({
|
||||
url
|
||||
url, ...axiosOption
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user