* vite是什么?
* 一个前端的开发构建工具
* 当我们的项目组件变大时,会自觉的分文件、分组件等操作,缩减单文件的大小、增加可维护性,vite则可以帮我们管理,并且它有很多插件帮助我们开发。
目录
初始化
- 创建一个文件夹,比如这里创建一个叫 mimicrymusic 的文件夹:
- 然后进入这个文件夹,或是把它拖进vscode中:
- 可以进VSCode内,使用终端运行以下命令:
- 初始化生成包配置文件:npm init -y
- 生成package.json:
- -
- 内容如下:
- -
- 其中:
- name:项目名
- version:版本号
- description:项目描述
- main:js入口
- scripts:配置用于npm的命令
- keywords:(可以不要)
- author:作者信息(可以不要)
- license:开源协议
安装vite依赖
- 在终端中执行命令:npm i vite -D
- 安装vite的开发环境依赖:
- 等待一段时间的下载:
- 下载完成后我们刚刚的包配置文件package.json中就会有自动增加一个vite的依赖:
安装vue的依赖
- 在终端中执行命令:npm i vue
- 等待安装完成以后,package.json中就会自动增加vue的配置:
创建index.html
- 在项目的根位置,即和package.json同级的位置创建一个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>
- 正如上面代码中注释所说,script标签引入了一个js文件到index.html,但我们还没有指定引入哪一个js文件,下面我们将创建这个文件,然后在引入。
创建main.js
- 在项目根位置创建src目录,然后在src内创建main.js文件:
- 里面我们可以先随便写一句输出: console.log("hello coolight");
- 保存文件
- 在我们刚刚的index.html中引入main.js文件:
<!-- 引用的js文件 -->
<script type="module" src="./src/main.js"></script>
- 在package.json中配置npm命令,即把里面的scripts的内容改为 "dev" : "vite"
尝试让它跑起来(1)
- 在终端中敲 npm run dev,就会有如下信息提示
- 键盘按住ctrl,然后鼠标左键点击终端里图中框起来的链接(不要点我的图,点你的终端里的!!!):
- 它就会跳转到浏览器,显示我们刚刚写的页面
- 一片空白则是正常的,因为我们的页面并没有写东西
- 我们的js也只写了一句输出,这时候要在浏览器中打开控制台看看有没有这句输出
- 浏览器中来到我们写的页面
- 在浏览器中按一下键盘F12键
- 浏览器就会弹出一个窗口:
- 此时点击控制台,就可以看见我们的main.js的输出了:
创建App.vue
- 在src目录下,新建 App.vue 文件:
- 内容可以随便写点,比如:
<template>
<div>
你好 coolight
</div>
</template>
在main.js中创建vue,安装vitejs
- 修改main.js的内容为:
import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
app.mount('#app')
- 可以看到,我们在main.js中创建的vue需要一个挂载点,在html中一个id为 app 的元素
- 所以我们需要在index.html中增加一个 <div id="app"></div> :
- 保存文件
- 此时你可能发现,欸vite好像报错了:
- [vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.
- 浏览器里我们的页面也有报错:
- 它的意思很明显,需要我们去安装 @vitejs/plugin-vue,因为浏览器正常执行不了vue文件,所以需要安装插件来编译解析。
- 那么我们就来安装它。
- 如果你的终端vite还在运行,也就是没有显示提示让你输入,就像这样:
- 那么就按键盘ctrl + c ,停止掉vite
- 它会问你 终止批处理操作吗(Y/N)?
- 我们输入 y ,然后回车即可
- 然后再输入 npm i @vitejs/plugin-vue -D
- 等待下载安装:
- 然后在项目根目录创建vite的配置文件:vite.config.js
- 里面写如下配置:
import { defineConfig } from "vite"
import Vue from "@vitejs/plugin-vue"
export default defineConfig({
plugins:[
Vue()
]
})
- 保存文件
- 在终端中执行 npm run dev
- 然后回到浏览器中看看我们的页面,就会发现已经正常了!
结语
- 这个是手动配置的方法,其实有很简单的一键操作。
- 后面我们聊聊给手动配置路由router,状态管理pinia等
no prescription pharmacy paypal: canadian online pharmacy no prescription – canada drugs coupon code
http://clomida.pro/# where buy clomid without insurance
Я хочу выразить свою глубокую благодарность ремонт ноутбуков за их профессиональный подход. Они быстро и качественно отремонтировали мой ноутбук, и он снова функционирует безупречно. Персонал проявил высокий уровень профессионализма и клиентоориентированности, объяснив все детали ремонта. Результат превзошел все мои ожидания, и я непременно порекомендую их услуги всем, кому потребуется ремонт ноутбука
can i get clomid without insurance: order clomid without a prescription – where buy clomid without insurance
purchase desloratadine online cheap – buy flixotide cheap buy albuterol sale
zithromax azithromycin zithromax capsules purchase zithromax online
Intro
betvisa india
Betvisa india | IPL 2024 Heat Wave
IPL 2024 Big bets, big prizes With Betvisa India
Exclusive for Sports Fans Betvisa Online Casino 50% Welcome Bonus
Crash Game Supreme Compete for 1,00,00,000 pot Betvisa.com
#betvisaindia
Accurate Predictions IPL T20 Tournament, Winner Takes All!
More than just a game | Betvisa dreams invites you to fly to malta
https://www.b3tvisapro.com/
#betvisaindia #betvisalogin #betvisaonlinecasino
#betvisa.com #betvisaapp
Khám phá Thế Giới Cá Cược Trực Tuyến với BetVisa!
Dịch vụ BetVisa, một trong những nền tảng hàng đầu tại châu Á, được thành lập vào năm 2017 và thao tác dưới phê chuẩn của Curacao, đã thu hút hơn 2 triệu người dùng trên toàn thế giới. Với lời hứa đem đến trải nghiệm cá cược an toàn và tin cậy nhất, BetVisa nhanh chóng trở thành lựa chọn hàng đầu của người chơi trực tuyến.
BetVisa không dừng lại ở việc cung cấp các trò chơi phong phú như xổ số, sòng bạc trực tiếp, thể thao trực tiếp và thể thao điện tử, mà còn mang đến cho người chơi những ưu đãi hấp dẫn. Thành viên mới đăng ký sẽ được tặng ngay 5 phần quà miễn phí và có cơ hội giành giải thưởng lớn.
Đặc biệt, BetVisa hỗ trợ nhiều phương thức thanh toán linh hoạt như Betvisa Vietnam, cùng với các ưu đãi độc quyền như thưởng chào mừng lên đến 200%. Bên cạnh đó, hàng tuần còn có các chương trình khuyến mãi độc đáo như chương trình giải thưởng Sinh Nhật và Chủ Nhật Mua Sắm Điên Cuồng, mang đến cho người chơi cơ hội thắng lớn.
Vì tính cam kết về trải nghiệm cá cược hoàn hảo nhất và dịch vụ khách hàng chuyên trách, BetVisa tự tin là điểm đến lý tưởng cho những ai phấn khích trò chơi trực tuyến. Hãy đăng ký ngay hôm nay và bắt đầu hành trình của bạn tại BetVisa – nơi niềm vui và may mắn chính là điều không thể thiếu.
Intro
betvisa india
Betvisa india | IPL 2024 Heat Wave
IPL 2024 Big bets, big prizes With Betvisa India
Exclusive for Sports Fans Betvisa Online Casino 50% Welcome Bonus
Crash Game Supreme Compete for 1,00,00,000 pot Betvisa.com
#betvisaindia
Accurate Predictions IPL T20 Tournament, Winner Takes All!
More than just a game | Betvisa dreams invites you to fly to malta
https://www.b3tvisapro.com/
#betvisaindia #betvisalogin #betvisaonlinecasino
#betvisa.com #betvisaapp
Khám phá Thế Giới Cá Cược Trực Tuyến với BetVisa!
BetVisa Vietnam, một trong những công ty hàng đầu tại châu Á, được thành lập vào năm 2017 và thao tác dưới bằng của Curacao, đã thu hút hơn 2 triệu người dùng trên toàn thế giới. Với lời hứa đem đến trải nghiệm cá cược an toàn và tin cậy nhất, BetVisa nhanh chóng trở thành lựa chọn hàng đầu của người chơi trực tuyến.
BetVisa không chỉ cung cấp các trò chơi phong phú như xổ số, sòng bạc trực tiếp, thể thao trực tiếp và thể thao điện tử, mà còn mang đến cho người chơi những ưu đãi hấp dẫn. Thành viên mới đăng ký sẽ được tặng ngay 5 cơ hội miễn phí và có cơ hội giành giải thưởng lớn.
Đặc biệt, BetVisa hỗ trợ nhiều hình thức thanh toán linh hoạt như Betvisa Vietnam, cùng với các ưu đãi độc quyền như thưởng chào mừng lên đến 200%. Bên cạnh đó, hàng tuần còn có các chương trình khuyến mãi độc đáo như chương trình giải thưởng Sinh Nhật và Chủ Nhật Mua Sắm Điên Cuồng, mang đến cho người chơi cơ hội thắng lớn.
Với tính cam kết về trải nghiệm thú vị cá cược tốt nhất và dịch vụ khách hàng chuyên nghiệp, BetVisa hoàn toàn tự hào là điểm đến lý tưởng cho những ai nhiệt tình trò chơi trực tuyến. Hãy tham gia ngay hôm nay và bắt đầu chuyến đi của bạn tại BetVisa – nơi niềm vui và may mắn chính là điều không thể thiếu được.
cost of clomid without insurance: where can i buy clomid without a prescription – where to get cheap clomid
https://prednisonea.store/# 15 mg prednisone daily
JDBslot
JDB slot | The first bonus to rock the slot world
Exclusive event to earn real money and slot game points
JDB demo slot games for free = ?? Lucky Spin Lucky Draw!
How to earn reels free 2000? follow jdb slot games for free
#jdbslot
Demo making money : https://jdb777.com
#jdbslot #slotgamesforfree #howtoearnreels #cashreels
#slotgamepoint #demomakingmoney
Cash reels only at slot games for free
More professional jdb game bonus knowledge
Methods to Secure Turns Credit Costless 2000: Your Supreme Guide to Victorious Large with JDB Slots
Are you prepared to embark on an electrifying voyage into the universe of online slot games? Look no additional, simply turn to JDB777 FreeGames, where excitement and substantial wins await you at every single rotation of the reel. In this all-encompassing instruction, we’ll show you methods to earn reels credits gratis 2000 and open the exhilarating world of JDB slots.
Live through the Thrill of Gaming Games for Free
At JDB777 FreeGames, we offer a wide selection of captivating slot games that are certain to keep you entertained for hours on end. From vintage fruit machines to immersive themed slots, there’s something for each variety of player to enjoy. And the top part? You can play all of our slot games for free and gain real cash prizes!
Unlock Free Cash Reels and Win Big
One of the most stimulating features of JDB777 FreeGames is the chance to secure reels credits costless 2000, which can be exchanged for real cash. Just sign up for an account, and you’ll obtain your costless bonus to commence spinning and winning. With our liberal promotions and bonuses, the sky’s the boundary when it comes to your winnings!
Direct Approaches and Points System
To maximize your winnings and open the full potential of our slot games, it’s essential to grasp the approaches and points system. Our expert guides will take you through everything you need to know, from choosing out the right games to understanding how to acquire bonus points and cash prizes.
Distinctive Promotions and Special Offers
As a member of JDB777 FreeGames, you’ll have access to exclusive promotions and special offers that are guaranteed to improve your gaming experience. From welcome bonuses to daily rebates, there are a lot of opportunities to improve your winnings and take your gameplay to the subsequent level.
Join Us Today and Start Winning
Don’t miss out on your opportunity to win big with JDB777 FreeGames. Sign up now to assert your complimentary bonus of 2000 credits and commence spinning the reels for your chance to win real cash prizes. With our thrilling selection of slot games and generous promotions, the prospects are endless. Join us today and start winning!
cost of amoxicillin 875 mg: where to get amoxicillin over the counter – buy amoxicillin online cheap
buy prednisone online australia: prednisone generic cost – generic prednisone for sale
where to buy cheap clomid without insurance buying cheap clomid without insurance can i buy generic clomid pills
glipizide and sitagliptin
methylprednisolone pill – cetirizine 5mg over the counter azelastine 10ml generic
Услуга по сносу старых домов и вывозу мусора в Москве и Московской области. Мы предоставляем услуги по сносу старых зданий и удалению мусора на территории Москвы и Подмосковья. Услуга демонтаж дома выполняется опытными специалистами в течение 24 часов после оформления заказа. Перед началом работ наш эксперт бесплатно приезжает на объект для оценки объёма работ и консультации. Чтобы получить дополнительную информацию и рассчитать стоимость услуг, свяжитесь с нами по телефону или оставьте заявку на сайте компании.
http://stromectola.top/# ivermectin new zealand
Intro
betvisa bangladesh
Betvisa bangladesh | Super Cricket Carnival with Betvisa!
IPL Cricket Mania | Kick off Super Cricket Carnival with bet visa.com
IPL Season | Exclusive 1,50,00,000 only at Betvisa Bangladesh!
Crash Games Heroes | Climb to the top of the 1,00,00,000 bonus pool!
#betvisabangladesh
Preview IPL T20 | Follow Betvisa BD on Facebook, Instagram for awards!
betvisa affiliate Dream Maltese Tour | Sign up now to win the ultimate prize!
https://www.bvthethao.com/
#betvisabangladesh #betvisabd #betvisaaffiliate
#betvisaaffiliatesignup #betvisa.com
Vì sự cam kết về kinh nghiệm cá cược tốt hơn nhất và dịch vụ khách hàng kỹ năng chuyên môn, BetVisa tự tin là điểm đến lý tưởng cho những ai phấn khích trò chơi trực tuyến. Hãy tham gia ngay hôm nay và bắt đầu cuộc hành trình của bạn tại BetVisa – nơi niềm vui và may mắn chính là điều không thể thiếu.
Tìm hiểu Thế Giới Cá Cược Trực Tuyến với BetVisa!
Hệ thống BetVisa, một trong những nền tảng hàng đầu tại châu Á, ra đời vào năm 2017 và thao tác dưới bằng của Curacao, đã có hơn 2 triệu người dùng trên toàn thế giới. Với cam kết đem đến trải nghiệm cá cược đảm bảo và tin cậy nhất, BetVisa nhanh chóng trở thành lựa chọn hàng đầu của người chơi trực tuyến.
BetVisa không chỉ cung cấp các trò chơi phong phú như xổ số, sòng bạc trực tiếp, thể thao trực tiếp và thể thao điện tử, mà còn mang đến cho người chơi những ưu đãi hấp dẫn. Thành viên mới đăng ký sẽ được tặng ngay 5 cơ hội miễn phí và có cơ hội giành giải thưởng lớn.
Đặc biệt, BetVisa hỗ trợ nhiều hình thức thanh toán linh hoạt như Betvisa Vietnam, cùng với các ưu đãi độc quyền như thưởng chào mừng lên đến 200%. Bên cạnh đó, hàng tuần còn có các chương trình khuyến mãi độc đáo như chương trình giải thưởng Sinh Nhật và Chủ Nhật Mua Sắm Điên Cuồng, mang đến cho người chơi cơ hội thắng lớn.
prednisone online australia: prednisone buying – buy prednisone online without a script
minocycline coupon: ivermectin malaria – minocycline antibiotic
provera synthroid
JDB online
JDB online | 2024 best online slot game demo cash
How to earn reels? jdb online accumulate spin get bonus
Hot demo fun: Quick earn bonus for ranking demo
JDB demo for win? JDB reward can be exchanged to real cash
#jdbonline
777 sign up and get free 2,000 cash: https://www.jdb777.io/
#jdbonline #democash #demofun #777signup
#rankingdemo #demoforwin
2000 cash: Enter email to verify, enter verify, claim jdb bonus
Play with JDB games an online platform in every countries.
Enjoy the Delight of Gaming!
Costless to Join, Costless to Play.
Join and Obtain a Bonus!
SIGN UP NOW AND OBTAIN 2000?
We dare you to acquire a demonstration entertaining welcome bonus for all new members! Plus, there are other particular promotions waiting for you!
Find out more
JDB – NO COST TO JOIN
Straightforward to play, real profit
Join JDB today and indulge in fantastic games without any investment! With a wide array of free games, you can delight in pure entertainment at any time.
Quick play, quick join
Value your time and opt for JDB’s swift games. Just a few easy steps and you’re set for an amazing gaming experience!
Register now and make money
Experience JDB: Instant play with no investment and the opportunity to win cash. Designed for effortless and lucrative play.
Immerse into the Universe of Online Gaming Stimulation with Fun Slots Online!
Are you set to feel the excitement of online gaming like never before? Look no further than Fun Slots Online, your ultimate endpoint for heart-pounding gameplay, endless entertainment, and thrilling winning opportunities!
At Fun Slots Online, we pride ourselves on giving a wide array of engaging games designed to hold you involved and pleased for hours on end. From classic slot machines to innovative new releases, there’s something for each person to enjoy. Plus, with our user-friendly interface and uninterrupted gameplay experience, you’ll have no difficulty diving straight into the activity and savoring every moment.
But that’s not all – we also provide a selection of exclusive promotions and bonuses to reward our loyal players. From greeting bonuses for new members to privileged rewards for our top players, there’s always something exhilarating happening at Fun Slots Online. And with our secure payment system and 24-hour customer support, you can enjoy peace of mind cognizant that you’re in good hands every step of the way.
So why wait? Sign up Fun Slots Online today and begin your adventure towards breath-taking victories and jaw-dropping prizes. Whether you’re a seasoned gamer or just starting out, there’s never been a better time to engage in the fun and excitement at Fun Slots Online. Sign up now and let the games begin!
spironolactone leg cramps
JDB demo
JDB demo | The easiest bet software to use (jdb games)
JDB bet marketing: The first bonus that players care about
Most popular player bonus: Daily Play 2000 Rewards
Game developers online who are always with you
#jdbdemo
Where to find the best game developer? https://www.jdbgaming.com/
#gamedeveloperonline #betsoftware #betmarketing
#developerbet #betingsoftware #gamedeveloper
Supports hot jdb demo beting software jdb angry bird
JDB slot demo supports various competition plans
Revealing Success with JDB Gaming: Your Ultimate Betting Software Solution
In the realm of internet gaming, finding the correct bet software is crucial for success. Introducing JDB Gaming – a foremost supplier of innovative gaming strategies designed to enhance the gaming experience and propel profits for operators. With a concentration on easy-to-use interfaces, enticing bonuses, and a varied selection of games, JDB Gaming stands out as a leading choice for both players and operators alike.
JDB Demo presents a glimpse into the world of JDB Gaming, providing players with an opportunity to feel the thrill of betting without any risk. With simple interfaces and smooth navigation, JDB Demo makes it simple for players to discover the vast selection of games available, from classic slots to immersive arcade titles.
When it regards bonuses, JDB Bet Marketing leads with attractive offers that attract players and keep them returning for more. From the well-liked Daily Play 2000 Rewards to unique promotions, JDB Bet Marketing makes sure that players are recognized for their allegiance and dedication.
With so several game developers online, identifying the best can be a intimidating task. However, JDB Gaming emerges from the masses with its commitment to perfection and innovation. With over 150 online casino games to select, JDB Gaming offers a bit for every player, whether you’re a fan of slots, fish shooting games, arcade titles, card games, or bingo.
At the center of JDB Gaming lies a commitment to offering the finest possible gaming experience for players. With a focus on Asian culture and impressive 3D animations, JDB Gaming distinguishes itself as a front runner in the industry. Whether you’re a player looking for excitement or an provider looking for a reliable partner, JDB Gaming has you covered.
API Integration: Seamlessly integrate with all platforms for optimal business chances. Big Data Analysis: Remain ahead of market trends and grasp player actions with thorough data analysis. 24/7 Technical Support: Relish peace of mind with skilled and dependable technical support available 24/7.
In conclusion, JDB Gaming provides a winning mix of advanced technology, enticing bonuses, and unequaled support. Whether you’re a gamer or an operator, JDB Gaming has everything that you need to excel in the world of online gaming. So why wait? Join the JDB Gaming community today and unleash your full potential!
amoxicillin capsules 250mg where can you get amoxicillin amoxicillin 500mg capsule
sweet bonanza real money http://sweet-bonanza-game.ru/ .
http://womangu.ru
zithromax generic cost: zithromax for sale us – zithromax 250mg
http://prednisonea.store/# online order prednisone 10mg
repaglinide and metformin hcl
https://clomida.pro/# clomid pills
generic amoxicillin online: amoxicillin online no prescription – how to buy amoxycillin
ivermectin 8 mg: stromectol canada – ivermectin stromectol
oral ivermectin cost stromectol for humans stromectol price us
methylprednisolone 8mg for sale – order fml-forte purchase astelin
is remeron a benzodiazepine
robaxin withdrawal
buy generic clomid without rx: how to get clomid no prescription – cost of clomid without insurance
amoxicillin buy no prescription amoxicillin 500mg capsule buy online can i buy amoxicillin over the counter in australia
ivermectin 1% cream generic: ivermectin humans – ivermectin 1% cream generic
robot88
prednisone 60 mg price: prednisone 5 50mg tablet price – where to get prednisone
tamoxifen: femara vs tamoxifen – tamoxifen for sale
natural alternatives to tamoxifen: where can i buy nolvadex – tamoxifen therapy
diflucan discount coupon buy diflucan medicarions can i buy diflucan in mexico
buy ventolin inhalator online cheap – seroflo online order theo-24 Cr 400mg for sale
buy cipro online: ciprofloxacin generic – cipro online no prescription in the usa
Intro
betvisa philippines
Betvisa philippines | The Filipino Carnival, Spinning for Treasures!
Betvisa Philippines Surprises | Spin daily and win ₱8,888 Grand Prize!
Register for a chance to win ₱8,888 Bonus Tickets! Explore Betvisa.com!
Wild All Over Grab 58% YB Bonus at Betvisa Casino! Take the challenge!
#betvisaphilippines
Get 88 on your first 50 Experience Betvisa Online’s Bonus Gift!
Weekend Instant Daily Recharge at betvisa.com
https://www.88betvisa.com/
#betvisaphilippines #betvisaonline #betvisacasino
#betvisacom #betvisa.com
Nền tảng cá cược – Điểm Đến Tuyệt Vời Cho Người Chơi Trực Tuyến
Khám Phá Thế Giới Cá Cược Trực Tuyến với BetVisa!
Nền tảng cá cược được thiết lập vào năm 2017 và hoạt động theo bằng trò chơi Curacao với hơn 2 triệu người dùng. Với lời hứa đem đến trải nghiệm cá cược đáng tin cậy và tin cậy nhất, BetVisa nhanh chóng trở thành lựa chọn hàng đầu của người chơi trực tuyến.
BetVisa không chỉ cung cấp các trò chơi phong phú như xổ số, sòng bạc trực tiếp, thể thao trực tiếp và thể thao điện tử, mà còn mang lại cho người chơi những phần thưởng hấp dẫn. Thành viên mới đăng ký sẽ được tặng ngay 5 vòng quay miễn phí và có cơ hội giành giải thưởng lớn.
BetVisa hỗ trợ nhiều cách thức thanh toán linh hoạt như Betvisa Vietnam, cùng với các ưu đãi độc quyền như thưởng chào mừng lên đến 200%. Bên cạnh đó, hàng tuần còn có các chương trình khuyến mãi độc đáo như chương trình giải thưởng Sinh Nhật và Chủ Nhật Mua Sắm Điên Cuồng, mang lại cho người chơi thời cơ thắng lớn.
Với sự cam kết về trải nghiệm cá cược tốt nhất và dịch vụ khách hàng chất lượng, BetVisa tự tin là điểm đến lý tưởng cho những ai đam mê trò chơi trực tuyến. Hãy đăng ký ngay hôm nay và bắt đầu hành trình của bạn tại BetVisa – nơi niềm vui và may mắn chính là điều tất yếu!
tamoxifen citrate: tamoxifen hot flashes – where can i buy nolvadex