mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-05-21 16:29:15 +08:00
chore: remove deps
remove `vite-plugin-vue-setup-extend`
This commit is contained in:
parent
446ee7794e
commit
4568d807b3
@ -1,6 +1,5 @@
|
|||||||
import type { PluginOption } from 'vite'
|
import type { PluginOption } from 'vite'
|
||||||
import UnoCSS from '@unocss/vite'
|
import UnoCSS from '@unocss/vite'
|
||||||
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
|
|
||||||
import vue from './vue'
|
import vue from './vue'
|
||||||
import compress from './compress'
|
import compress from './compress'
|
||||||
import visualizer from './visualizer'
|
import visualizer from './visualizer'
|
||||||
@ -15,7 +14,7 @@ import mock from './mock'
|
|||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
export function setVitePlugins(env: ImportMetaEnv) {
|
export function setVitePlugins(env: ImportMetaEnv) {
|
||||||
const plugins: PluginOption[] = [...vue, UnoCSS(), ...unplugin, mock, vueSetupExtend()]
|
const plugins: PluginOption[] = [...vue, UnoCSS(), ...unplugin, mock]
|
||||||
// 是否压缩
|
// 是否压缩
|
||||||
if (env.VITE_COMPRESS_OPEN === 'Y')
|
if (env.VITE_COMPRESS_OPEN === 'Y')
|
||||||
plugins.push(compress(env))
|
plugins.push(compress(env))
|
||||||
|
@ -2,6 +2,9 @@ import { viteMockServe } from 'vite-plugin-mock' // https://github.com/vbenjs/vi
|
|||||||
|
|
||||||
export default viteMockServe({
|
export default viteMockServe({
|
||||||
mockPath: 'mock',
|
mockPath: 'mock',
|
||||||
// enable: true,
|
prodEnabled: true,
|
||||||
// watchFiles: false,
|
injectCode: `
|
||||||
|
import { setupMockServer } from '../mock';
|
||||||
|
setupMockServer();
|
||||||
|
`,
|
||||||
})
|
})
|
||||||
|
@ -5,10 +5,6 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
|
|||||||
// https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx
|
// https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx
|
||||||
import VueDevTools from 'vite-plugin-vue-devtools' // https://github.com/webfansplz/vite-plugin-vue-devtools
|
import VueDevTools from 'vite-plugin-vue-devtools' // https://github.com/webfansplz/vite-plugin-vue-devtools
|
||||||
|
|
||||||
const plugins = [vue({
|
const plugins = [vue(), vueJsx(), VueDevTools()]
|
||||||
script: {
|
|
||||||
defineModel: true,
|
|
||||||
},
|
|
||||||
}), vueJsx(), VueDevTools()]
|
|
||||||
|
|
||||||
export default plugins
|
export default plugins
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
<title>%VITE_APP_TITLE%</title>
|
<title>%VITE_APP_TITLE%</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"><div id="appLoading"></div></div>
|
<div id="appLoading"></div>
|
||||||
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -191,7 +191,7 @@ const userRoutes = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'plugin_map',
|
name: 'PluginMap',
|
||||||
path: '/plugin/map',
|
path: '/plugin/map',
|
||||||
meta: {
|
meta: {
|
||||||
title: '地图',
|
title: '地图',
|
||||||
|
@ -94,10 +94,9 @@
|
|||||||
"unplugin-vue-components": "^0.25.1",
|
"unplugin-vue-components": "^0.25.1",
|
||||||
"vite": "^4.3.9",
|
"vite": "^4.3.9",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-mock": "^2.9.6",
|
"vite-plugin-mock": "^2.9.8",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vite-plugin-vue-devtools": "^0.2.1",
|
"vite-plugin-vue-devtools": "^0.2.1",
|
||||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
|
||||||
"vue-tsc": "^1.8.1"
|
"vue-tsc": "^1.8.1"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
@ -7,8 +7,6 @@ import themeConfig from './theme.json'
|
|||||||
const locale = zhCN
|
const locale = zhCN
|
||||||
const dateLocale = dateZhCN
|
const dateLocale = dateZhCN
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
// const osThemeRef = useOsTheme()
|
|
||||||
// appStore.toggleDarkMode(osThemeRef.value === 'dark')
|
|
||||||
|
|
||||||
const themeOverrides: GlobalThemeOverrides = {} || themeConfig
|
const themeOverrides: GlobalThemeOverrides = {} || themeConfig
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,9 +5,16 @@ import { MdEditor } from 'md-editor-v3' // https://imzbf.github.io/md-editor-v3/
|
|||||||
import 'md-editor-v3/lib/style.css'
|
import 'md-editor-v3/lib/style.css'
|
||||||
import { useAppStore } from '@/store'
|
import { useAppStore } from '@/store'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
modelValue: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const modelValue = defineModel()
|
const data = useVModel(props, 'modelValue', emit)
|
||||||
|
|
||||||
const theme = computed(() => {
|
const theme = computed(() => {
|
||||||
return appStore.darkMode ? 'dark' : 'light'
|
return appStore.darkMode ? 'dark' : 'light'
|
||||||
})
|
})
|
||||||
@ -23,7 +30,7 @@ const toolbarsExclude: ToolbarNames[] = [
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MdEditor
|
<MdEditor
|
||||||
v-model="modelValue" :theme="theme" read-only :toolbars-exclude="toolbarsExclude"
|
v-model="data" :theme="theme" read-only :toolbars-exclude="toolbarsExclude"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Editor from '@tinymce/tinymce-vue'
|
import Editor from '@tinymce/tinymce-vue'
|
||||||
|
|
||||||
const modelValue = defineModel()
|
const props = defineProps<{
|
||||||
|
modelValue: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const data = useVModel(props, 'modelValue', emit)
|
||||||
|
|
||||||
function imagesUploadHandler(blobInfo: any, _progress: number) {
|
function imagesUploadHandler(blobInfo: any, _progress: number) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -51,7 +57,7 @@ const initConfig = {
|
|||||||
<template>
|
<template>
|
||||||
<div class="tinymce-boxz">
|
<div class="tinymce-boxz">
|
||||||
<Editor
|
<Editor
|
||||||
v-model="modelValue"
|
v-model="data"
|
||||||
api-key="no-api"
|
api-key="no-api"
|
||||||
:init="initConfig"
|
:init="initConfig"
|
||||||
/>
|
/>
|
||||||
|
@ -29,5 +29,3 @@ async function initMap() {
|
|||||||
class="w-full h-full"
|
class="w-full h-full"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts" name="plugin_map">
|
<script setup lang="ts">
|
||||||
import AMap from './components/AMap.vue'
|
import AMap from './components/AMap.vue'
|
||||||
import BMap from './components/BMap.vue'
|
import BMap from './components/BMap.vue'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'PluginMap',
|
||||||
|
})
|
||||||
|
|
||||||
const maps = [
|
const maps = [
|
||||||
{
|
{
|
||||||
id: 'AMap',
|
id: 'AMap',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user