Bladeren bron

setup 组件名称问题

wangkang3 2 jaren geleden
bovenliggende
commit
3e2be5edc5

+ 2 - 1
common/vue/project/vite-js-base/package.json

@ -31,6 +31,7 @@
31 31
    "unplugin-auto-import": "^0.11.2",
32 32
    "unplugin-vue-components": "^0.22.4",
33 33
    "vite": "^3.0.7",
34
    "vite-plugin-svg-icons": "^2.0.1"
34
    "vite-plugin-svg-icons": "^2.0.1",
35
    "vite-plugin-vue-setup-extend": "^0.4.0"
35 36
  }
36 37
}

+ 1 - 1
common/vue/project/vite-js-base/src/views/index.js

@ -10,7 +10,7 @@ export default [
10 10
  },
11 11
  {
12 12
    path: '/overview',
13
    name: 'Overview',
13
    name: 'overview',
14 14
    meta: {
15 15
      title: '方案概览',
16 16
      keepAlive: true

+ 1 - 1
common/vue/project/vite-js-base/src/views/login/login.vue

@ -6,7 +6,7 @@
6 6
    <svg-icon class="icon" name="xiugai" :size="22"></svg-icon>
7 7
  </div>
8 8
</template>
9
<script setup>
9
<script setup name="login">
10 10
import { getCurrentInstance, ref } from 'vue'
11 11
import { useStore } from 'vuex'
12 12
const num = ref(0)

+ 8 - 1
common/vue/project/vite-js-base/src/views/main/main.vue

@ -1,5 +1,7 @@
1 1
<template>
2 2
  <base-panel title="记得加">
3
    <div>{{ num }}</div>
4
    <el-button @click="add">Default</el-button>
3 5
    <base-form ref="formRef" v-bind="FormConfig" v-model="formData"></base-form>
4 6
    <el-button @click="check">check</el-button>
5 7
    <base-table
@ -12,8 +14,13 @@
12 14
  </base-panel>
13 15
</template>
14 16
15
<script setup>
17
<script setup name="overview">
16 18
import { ref } from 'vue'
19
const num = ref(0)
20
21
const add = () => {
22
  num.value = num.value + 1
23
}
17 24
const formData = ref({})
18 25
const FormConfig = ref({
19 26
  labelWidth: '100px',

+ 3 - 2
common/vue/project/vite-js-base/vite.config.js

@ -4,7 +4,7 @@ import { resolve } from 'path'
4 4
import AutoImport from 'unplugin-auto-import/vite'
5 5
import Components from 'unplugin-vue-components/vite'
6 6
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
7
7
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
8 8
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
9 9
10 10
// https://vitejs.dev/config/
@ -26,7 +26,8 @@ export default defineConfig(({ command, mode }) => {
26 26
        svgoOptions: true,
27 27
        // 指定symbolId格式
28 28
        symbolId: 'icon-[dir]-[name]'
29
      })
29
      }),
30
      VueSetupExtend()
30 31
    ],
31 32
    resolve: {
32 33
      alias: [