VUE框架基于Vite的Vue3搭建项目的脚手架------VUE框架

  data:
    redis:
      lettuce:
        cluster:
          refresh:
            adaptive: true
            period: 2000
        pool:
          max-idle: 8
          min-idle: 0
          max-wait: -1ms
          max-active: 8
      password: abc123
      database: 0
      cluster:
        nodes: 192.168.189.128:6381,192.168.189.128:6382,192.168.189.130:6383,192.168.189.130:6384,192.168.189.129:6385,192.168.189.129:6386
        max-redirects: 3
      timeout: 5000

  data:
    redis:
      lettuce:
        cluster:
          refresh:
            adaptive: true
            period: 2000
        pool:
          max-idle: 8
          min-idle: 0
          max-wait: -1ms
          max-active: 8
      password: abc123
      database: 0
      cluster:
        nodes: 192.168.189.128:6381,192.168.189.128:6382,192.168.189.130:6383,192.168.189.130:6384,192.168.189.129:6385,192.168.189.129:6386
        max-redirects: 3
      timeout: 5000

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server:{
    host:'0.0.0.0',//IP地址
    port:8080,//设置服务端口号
    open:false//服务启动需不需要打开浏览器
  }
})

import { defineConfig } from 'vite'

import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/

export default defineConfig({

  plugins: [vue()],

  server:{

    host:'0.0.0.0',//IP地址

    port:8080,//设置服务端口号

    open:false//服务启动需不需要打开浏览器

  }

})

{
  "name": "netcrm-front",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "element-plus": "^2.5.3",
    "vue": "^3.3.11"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.5.2",
    "vite": "^5.0.8"
  }
}

{

  "name": "netcrm-front",

  "private": true,

  "version": "0.0.0",

  "type": "module",

  "scripts": {

    "dev": "vite",

    "build": "vite build",

    "preview": "vite preview"

  },

  "dependencies": {

    "element-plus": "^2.5.3",

    "vue": "^3.3.11"

  },

  "devDependencies": {

    "@vitejs/plugin-vue": "^4.5.2",

    "vite": "^5.0.8"

  }

}

<template>
    <h1>啊哈哈哈,我又回来了</h1>
    <h1>{{ i }}</h1>
    <button @click="add">按一下</button>
</template>

<script>
import { ref } from 'vue';
export default {
    name : "App",
    setup(){
        let i = ref(10);
        function add(){
            this.i++;
        }
        return {i,add}
    }
}
</script>

<style>

</style>

<template>

    <h1>啊哈哈哈,我又回来了</h1>

    <h1>{{ i }}</h1>

    <button @click="add">按一下</button>

</template>

<script>

import { ref } from 'vue';

export default {

    name : "App",

    setup(){

        let i = ref(10);

        function add(){

            this.i++;

        }

        return {i,add}

    }

}

</script>

<style>

</style>

// 程序入口,相当于main方法
// 这里从vue下导入了一个createApp方法\函数
import { createApp } from 'vue'
// 从Element-Plus导入该组件
import ElementPlus from 'element-plus'
// 导入了我们默认的app组件
import App from './App.vue'
import 'element-plus/dist/index.css'

// 利用上面导入的createApp函数创建一个vue应用
// 并将app挂载到这个#app这个ID下
createApp(App).use(ElementPlus).mount('#app')

// 程序入口,相当于main方法

// 这里从vue下导入了一个createApp方法\函数

import { createApp } from 'vue'

// 从Element-Plus导入该组件

import ElementPlus from 'element-plus'

// 导入了我们默认的app组件

import App from './App.vue'

import 'element-plus/dist/index.css'

// 利用上面导入的createApp函数创建一个vue应用

// 并将app挂载到这个#app这个ID下

createApp(App).use(ElementPlus).mount('#app')

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + Vue</title>
  </head>
  <body>
    <div id="app">
      刚才所导入的app就会挂载到这里
    </div>
    <script type="module" src="/src/main.js"></script>
  </body>
</html>

<!doctype html>

<html lang="en">

  <head>

    <meta charset="UTF-8" />

    <link rel="icon" type="image/svg+xml" href="/vite.svg" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Vite + Vue</title>

  </head>

  <body>

    <div id="app">

      刚才所导入的app就会挂载到这里

    </div>

    <script type="module" src="/src/main.js"></script>

  </body>

</html>

  • 24
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值