Browse Source

Merge branch 'master' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm

YunaiV 7 months ago
parent
commit
c391ba7689
6 changed files with 8 additions and 7 deletions
  1. 0 0
      .eslintrc.js
  2. 1 1
      .vscode/settings.json
  3. 0 1
      package.json
  4. 1 1
      postcss.config.js
  5. 0 0
      prettier.config.js
  6. 6 4
      src/views/infra/build/index.vue

+ 0 - 0
.eslintrc.cjs → .eslintrc.js


+ 1 - 1
.vscode/settings.json

@@ -138,7 +138,7 @@
     "*.ts": "$(capture).test.ts, $(capture).test.tsx",
     "*.tsx": "$(capture).test.ts, $(capture).test.tsx",
     "*.env": "$(capture).env.*",
-    "package.json": "pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.eslintrc-auto-import.json,.gitignore,prettier.config.cjs,stylelint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.cjs,.eslintignore"
+    "package.json": "pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.eslintrc-auto-import.json,.gitignore,prettier.config.js,stylelint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.js,.eslintignore"
   },
   "terminal.integrated.scrollback": 10000,
   "nuxt.isNuxtApp": false

+ 0 - 1
package.json

@@ -4,7 +4,6 @@
   "description": "基于vue3、vite4、element-plus、typesScript",
   "author": "xingyu",
   "private": false,
-  "type": "module",
   "scripts": {
     "i": "pnpm install",
     "dev": "vite --mode env.local",

+ 1 - 1
postcss.config.js

@@ -1,4 +1,4 @@
-export default  {
+module.exports = {
   plugins: {
     autoprefixer: {}
   }

+ 0 - 0
prettier.config.cjs → prettier.config.js


+ 6 - 4
src/views/infra/build/index.vue

@@ -135,7 +135,8 @@ const makeTemplate = () => {
 
 /** 复制 **/
 const copy = async (text: string) => {
-  const { copy, copied, isSupported } = useClipboard({ source: text })
+  const textToCopy = JSON.stringify(text, null, 2)
+  const { copy, copied, isSupported } = useClipboard({ source: textToCopy })
   if (!isSupported) {
     message.error(t('common.copyError'))
   } else {
@@ -149,17 +150,18 @@ const copy = async (text: string) => {
 /**
  * 代码高亮
  */
-const highlightedCode = (code) => {
+const highlightedCode = (code: string) => {
   // 处理语言和代码
   let language = 'json'
   if (formType.value === 2) {
     language = 'xml'
   }
+  // debugger
   if (!isString(code)) {
-    code = JSON.stringify(code)
+    code = JSON.stringify(code, null, 2)
   }
   // 高亮
-  const result = hljs.highlight(language, code, true)
+  const result = hljs.highlight(code, { language: language, ignoreIllegals: true })
   return result.value || ' '
 }