[vue/vite]在vscode中使用vite手动创建vue项目

/ 3,901评论 / 17409阅读 / 14点赞

* vite是什么?

* 一个前端的开发构建工具

* 当我们的项目组件变大时,会自觉的分文件、分组件等操作,缩减单文件的大小、增加可维护性,vite则可以帮我们管理,并且它有很多插件帮助我们开发。

初始化

安装vite依赖

安装vue的依赖

创建index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标题</title>
</head>
<body>
    <!-- 引用的js文件位置 -->
    <script type="module" src=""></script>
</body>
</html>

创建main.js

    <!-- 引用的js文件 -->
    <script type="module" src="./src/main.js"></script>

尝试让它跑起来(1)

创建App.vue

<template>
    <div>
        你好 coolight
    </div>
</template>

在main.js中创建vue,安装vitejs

import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)

app.mount('#app')
import { defineConfig } from "vite"
import Vue from "@vitejs/plugin-vue"

export default defineConfig({
    plugins:[
        Vue()
    ]
})

结语

  1. RickyAlage说道:

    canadian pharmacy meds canadian pharmacies canadianpharmacymeds com

  2. Michaelsew说道:

    http://mexicoph24.life/# medication from mexico pharmacy

  3. LanceWeria说道:

    blacksprut2site xyz
    BlackSprut – это будущее! Используй Блэкспрут для быстрой покупки/продажи различных товаров. Быстрый и безопасный доступ к Блекспрут через TOR зеркало.

  4. StevenSen说道:

    mexican rx online: mexico pharmacy – buying prescription drugs in mexico online

  5. Marcelcrolf说道:

    https://indiaph24.store/# reputable indian online pharmacy

  6. RickyAlage说道:

    mail order pharmacy india buy medicines from India online shopping pharmacy india

  7. Marcelcrolf说道:

    http://canadaph24.pro/# canadian neighbor pharmacy

  8. Michaelsew说道:

    http://mexicoph24.life/# reputable mexican pharmacies online

  9. RickyAlage说道:

    mexican drugstore online mexico pharmacy mexican pharmaceuticals online

  10. Marcelcrolf说道:

    https://canadaph24.pro/# certified canadian international pharmacy

  11. RickyAlage说道:

    Online medicine order Cheapest online pharmacy indian pharmacy

  12. Vseido说道:

    terbinafine price – fulvicin buy online griseofulvin drug

  13. StevenSen说道:

    medicine in mexico pharmacies: mexican pharmacy – medicine in mexico pharmacies

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注