Skip to content

Commit

Permalink
chore: optimize useAdmateAdapter.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau committed Aug 12, 2024
1 parent 1acf123 commit a0db34b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
6 changes: 5 additions & 1 deletion demo/utils/useAdmateAdapter.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { computed, getCurrentInstance, onMounted, reactive, ref, toRefs, watch } from 'vue'
import { computed, getCurrentInstance, onMounted, reactive, ref, toRefs, watch } from 'vue-demi'
import { FaMessageBox } from 'faim'
import { cloneDeep, merge, mergeWith } from 'lodash-es'
import qs from 'qs'
// import VueCompositionAPI from '@vue/composition-api'
import useAdmate from '../../src'
import http from '@/utils/http'

// Vue@2.6 or earlier only
// Vue.use(VueCompositionAPI)

export default (
admateConfig,
{
Expand Down
1 change: 0 additions & 1 deletion demo/vue2.7/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default {

<template>
<div>
Vue 2 UI Framework demo:
<span
v-for="({ path }, i) of routes"
:key="i"
Expand Down
55 changes: 23 additions & 32 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,28 @@ export default {
},
},
},
plugins: [
{
name: 'html-transform',
transformIndexHtml(html: string) {
return html.replace(/\{\{ NAME \}\}/, name).replace(/\{\{ VUE_VERSION \}\}/g, String(major === 3 ? major : `${major}.${minor}`))
},
plugins: [{
name: 'html-transform',
transformIndexHtml(html: string) {
return html.replace(/\{\{ NAME \}\}/, name).replace(/\{\{ VUE_VERSION \}\}/g, String(major === 3 ? major : `${major}.${minor}`))
},
dts({ rollupTypes: true }),
AutoImport({
// targets to transform
include: [
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
/\.vue$/,
/\.vue\?vue/, // .vue
/\.md$/, // .md
],
// global imports to register
imports: [
// presets
(major === 3 || (major === 2 && minor >= 7)) ? 'vue' : '@vue/composition-api',
],
}),
UnoCSS({
presets: [
presetAttributify(),
presetUno(),
],
}),
Components(),
viteMockServe(),
{ ...visualizer(), apply: 'build' },
vue(),
],
}, dts({ rollupTypes: true }), AutoImport({
// targets to transform
include: [
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
/\.vue$/,
/\.vue\?vue/, // .vue
/\.md$/, // .md
],
// global imports to register
imports: [
// presets
(major === 3 || (major === 2 && minor >= 7)) ? 'vue' : '@vue/composition-api',
],
}), UnoCSS({
presets: [
presetAttributify(),
presetUno(),
],
}), Components(), viteMockServe(), { ...visualizer(), apply: 'build' }, vue()],
}

0 comments on commit a0db34b

Please sign in to comment.