* 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等
order premarin online premarin ca buy sildenafil online
order premarin 0.625mg generic oral premarin 0.625mg buy viagra 100mg sale
betahistine 16 mg brand order haldol 10mg pills purchase probenecid online
canadapharmacyonline.com
buy betahistine 16 mg pills haldol 10 mg sale probenecid 500 mg over the counter
ordering drugs from canada: best canadian online pharmacy – best canadian pharmacy online
purchase latanoprost generic buy rivastigmine 6mg generic buy exelon 3mg without prescription
Altogether! Finding information portals in the UK can be crushing, but there are scads resources ready to cure you espy the unexcelled the same as you. As I mentioned already, conducting an online search with a view http://scas.org.uk/wp-content/pages/martha-maccallum-age-how-old-is-martha-maccallum.html “UK scuttlebutt websites” or “British story portals” is a vast starting point. Not no more than determination this give you a encompassing tip of communication websites, but it will also lend you with a improved pact of the in the air news view in the UK.
On one occasion you secure a file of potential rumour portals, it’s critical to estimate each anyone to determine which overwhelm suits your preferences. As an example, BBC Dispatch is known benefit of its objective reporting of intelligence stories, while The Trustee is known pro its in-depth analysis of partisan and popular issues. The Disinterested is known for its investigative journalism, while The Times is known by reason of its work and investment capital coverage. By understanding these differences, you can pick out the information portal that caters to your interests and provides you with the news you have a yen for to read.
Additionally, it’s quality looking at neighbourhood pub news portals for proper to regions within the UK. These portals provide coverage of events and good copy stories that are relevant to the area, which can be specially utilitarian if you’re looking to keep up with events in your town community. In search exemplar, provincial good copy portals in London number the Evening Standard and the Londonist, while Manchester Evening Scuttlebutt and Liverpool Reproduction are stylish in the North West.
Comprehensive, there are diverse bulletin portals readily obtainable in the UK, and it’s high-level to do your research to remark the one that suits your needs. At near evaluating the unconventional news broadcast portals based on their coverage, style, and position statement viewpoint, you can choose the individual that provides you with the most fitting and attractive news stories. Decorous destiny with your search, and I hope this bumf helps you come up with the just right dope portal for you!
canadianpharmacy com: Certified Canada Pharmacy Online – reputable canadian online pharmacy
buy cheap generic latanoprost order rivastigmine generic purchase exelon generic
vasotec 5mg without prescription buy vasotec 5mg online buy generic duphalac for sale
purple pharmacy mexico price list: best online pharmacies in mexico – mexican rx online
vasotec over the counter order doxazosin 1mg online cheap purchase lactulose sale
המעסים המנוסים של זמן מגע ביצעו כבר מאות טיפולי עיסוי מפנק בהרצליה עד הבית לשביעות רצונם של כל המטופלים.
buy mestinon pyridostigmine tablet maxalt cost
דפי זהב יסייע לך בבחירת עיסוי תאילנדי, עם חוות דעת גולשים, מחירון, פורום מומחה ועוד!
buy ferrous generic generic sotalol 40 mg betapace medication
Europe is a continent with a in clover representation and dissimilar culture. Life in Europe varies greatly depending on the country and область, but there are some commonalities that can be observed.
Unified of the defining features of memoirs in Europe is the influential moment on work-life balance. Uncountable European countries be undergoing laws mandating a reliable amount of vacation speedily seeking workers, and some have reciprocate experimented with shorter workweeks. This allows in place of more in good time spent with next of kin and pursuing hobbies and interests.
https://www.machinefabriekelburg.nl/wp-content/pages/anna-berezina-s-humanitaire-bezoek-aan-rotterdam.html
Europe is also known object of its rich cultural legacy, with assorted cities boasting centuries-old architecture, astuteness wiles, and literature. Museums, galleries, and reliable sites are bountiful, and visitors can immerse themselves in the narrative and customs of the continent.
In addition to cultural attractions, Europe is retreat to a afield genre of natural beauty. From the impressive fjords of Norway to the genial beaches of the Mediterranean, there is no lack of stunning landscapes to explore.
Of ambit, spring in Europe is not without its challenges. Innumerable countries are grappling with issues such as income inconsistency, immigration, and public instability. Though, the people of Europe are resilient and get a fancy portrayal of overcoming adversity.
Blanket, existence in Europe is rich and varied, with something to advance for everyone. Whether you’re interested in retailing, enlightenment, temperament, or simply enjoying a believable work-life balance, Europe is a great lodgings to request home.
pyridostigmine 60mg sale order maxalt 10mg order rizatriptan 10mg
ferrous sulfate over the counter actonel ca betapace order online
Эмпайр скважин сверху водичку – этто эпидпроцесс создания отверстий в поднебесной для извлечения подземных вожак, кои смогут использоваться чтобы различных полнее, включая питьевую водичку, полив растений, индустриальные нужды да другие: https://pastelink.net/drxp5kx8. Чтобы бурения скважин используют специализированное ясс, таковское как бурильные установки, которые проникают в подлунную да основывают отверстия глубиной от пары 10-ов ут пары сотен метров.
После произведения скважины проводится тестирование, чтобы сосчитать нее производительность а также качество воды. Затем скважина оборудуется насосом и еще прочими теориями, чтоб обеспечить постоянный пропуск к воде. Хотя эмпайр скважин на воду представляет хорошую цена в течение обеспечении подхода ко чистой водопитьевой воде и утилизируется в течение различных отраслях индустрии, текущий эпидпроцесс может оказывать отрицательное воздействие на окружающую среду. То-то необходимо нарушать подходящие философия и регуляции.
Эмпайр скважин сверху водичку – это эпидпроцесс произведения отверстий в течение земле чтобы извлечения подземных вод. Сии скважины используются для водопитьевой воды, полива растений, индустриальных нищенствования и еще других целей. Эпидпроцесс бурения скважин включает в течение себя использование специализированного снабжения, подобного яко буровые предписания, тот или иной проходят на матушку-землю и еще основывают отверстия: https://www.openlearning.com/u/lewiswong-s0bqoa/blog/012345678. Эти скважины элементарно обладают глубину через пары 10-ов ут пары сторублевок метров.
Через некоторое время создания скважины, специалисты коротают тестирование, чтобы фиксировать ее производительность а также качество воды. Через некоторое время щель снабжается насосом и другими общественный порядок, чтобы обеспечить постоянный доступ ко воде. Бурение скважин на воду является принципиальным движением, который обеспечивает впуск. ant. выход к чистой водопитьевой восе также используется в разных отраслях промышленности. Однако, текущий процесс что ль насчитать негативное воздействие сверху охватывающую сферу, то-то необходимо соблюдать соответствующие философия равным образом регуляции.
how to get prasugrel without a prescription dramamine online buy tolterodine medication
buy generic prasugrel 10mg purchase prasugrel pills order detrol generic
To announce verified scoop, follow these tips:
Look representing credible sources: http://nature-et-avenir.org/files/pages/?what-is-a-video-news-release.html. It’s important to guard that the report outset you are reading is reliable and unbiased. Some examples of good sources subsume BBC, Reuters, and The Fashionable York Times. Read multiple sources to get a well-rounded understanding of a isolated info event. This can help you return a more complete display and dodge bias. Be hep of the position the article is coming from, as set respected hearsay sources can have bias. Fact-check the low-down with another fountain-head if a news article seems too staggering or unbelievable. Always make inevitable you are reading a advised article, as news can change-over quickly.
By means of following these tips, you can fit a more aware of dispatch reader and better be aware the world about you.
monograph canada pletal 100mg price cilostazol uk
כל זאת בשביל לאפשר לקהל
לקוחותינו בדיוק את מה שהם צריכים לקבל בשירות הטוב ביותר.
מהו מסאז/עיסוי רפואי? עיסוי רפואי
הוא התמחות בתחום העיסוי המאפשרת טיפול מורכב
ומקצועי יותר במקרים כגון עומס רגשי, מתח,
לחץ נפשי, דרך שחרור פיזי, שכן כבר ידוע שהגוף והנפש עובדים במשותף,
והמתח הנפשי שאנו אוגרים מלחצי היום
יום בעולם התובעני והדורשני שאנו חיים בו,
מצטבר בגופנו. מדובר בעיסוי המפעיל לחץ רב על הגוף ומומלץ בצורה מבוקרת ובמינונים מוקפדים על
פי תכנית טיפולים שנקבעה מראש
בעזרה וייעוץ של מטפלים מוסמכים בלבד.
לחץ דם גבוה הפך להיות לאחת מבעיות
הבריאות הנפוצות ביותר, גם בקרב בני
העשרים פלוס וזה ממש מדאיג. אז נכון שוולנטיינז דיי, כלומר,
יום האהבה, מוכר לרובנו בתור יום
האהבה בין בני זוג, אבל אני סביר להניח
אקדיש את היום הזה לאהבה לעצמי (ולא רק בגלל שסביר להניח שבן זוגי
ממש לא יודע על קיומו). שמן אבוקדו – שמן עשיר המזין עור יבש ומזדקן מעולה לטיפולי שיער אני משתמש בו במסאג קרקפת לא אשתמש בו במסאג גוף שמן
אבוקדו עוזר לשמור על טריות שמנים אחרים בשל תכונותו כפיקסטיב .
הקסם הגלילי, החווה האורגנית- האחראית
לקונספט’ היישר אל השולחן’ המאפיין את המלון, עם ההובלה של
שף ארז קומרובסקי- וכמובן הספא היוקרתי
מול הנוף הייחודי, מבטיחים הנאה מחוויית אירוח בסטנדרטים
מוקפדים( אתם מוזמנים לקרוא כתבה מורחבת על
המלון בגיליון זה.) אני גאה בהתפתחות ובצמיחה הזאת, הפורשת
למעלה מ5200- מקומות עבודה עבור משפחות
ברחבי ישראל- מראש פינה ויערות הכרמל בצפון, דרך
הרצליה ותל אביב במרכז, ים המלח, שדה בוקר ומצפה רמון,
ועד אילת בדרום.
כשאתם מתעניינים לגבי עיסוי במרכז,
דעו כי פתוחות בפניכם שתי אפשרויות עיקריות:
עיסוי בנס ציונה המתבצע בבית הפרטי שלכם או עיסוי בנס ציונה.
monograph 600mg pills order etodolac 600 mg online cheap buy generic cilostazol over the counter
בפורטל סקס אש יש מודעות של שירותי הליווי האיכותיים ביותר בלבד – כאלה שנבדקו ומבטיחים לכם שהבחורה שתגיע לביתכם היא בדיוק כמו
שביקשתם והיא.
buy fludrocortisone 100mcg generic dulcolax 5mg uk buy imodium no prescription
brillx регистрация
brillx казино
Брилкс казино предоставляет выгодные бонусы и акции для всех игроков. У нас вы найдете не только классические слоты, но и современные игровые разработки с прогрессивными джекпотами. Так что, возможно, именно здесь вас ждет величайший выигрыш, который изменит вашу жизнь навсегда!Как никогда прежде, в 2023 году Brillx Казино предоставляет широкий выбор увлекательных игровых автоматов, которые подарят вам незабываемые моменты радости и адреналина. С нами вы сможете насладиться великолепной графикой, захватывающими сюжетами и щедрыми выплатами. Бриллкс казино разнообразит ваш досуг, окунув вас в мир волнения и возможностей!
purple pharmacy mexico price list mexican online pharmacies prescription drugs best online pharmacies in mexico
cost florinef 100 mcg buy dulcolax 5 mg buy loperamide sale
canadian pharmacy checker: reliable canadian pharmacy – best mail order pharmacy canada
Online medicine home delivery: world pharmacy india – top online pharmacy india
medicine in mexico pharmacies: best online pharmacies in mexico – medication from mexico pharmacy
duphaston 10 mg usa order januvia online order empagliflozin 25mg generic
п»їlegitimate online pharmacies india top 10 online pharmacy in india pharmacy website india
duphaston uk buy forxiga no prescription jardiance 10mg us
order duphaston 10mg for sale jardiance 25mg tablet buy generic empagliflozin
http://misoprostol.guru/# Abortion pills online
https://misoprostol.guru/# cytotec pills buy online
https://misoprostol.guru/# cytotec pills buy online
order dipyridamole online buy generic plendil for sale order generic pravastatin 10mg
order meloset 3mg generic buy meloset generic danocrine 100mg pills
buy melatonin 3mg generic order melatonin 3mg generic danocrine 100mg usa
https://misoprostol.guru/# cytotec pills buy online
dipyridamole 100mg cost cost felodipine 5mg cost pravachol