如何安装svelte
介绍 (Introduction)
When building applications with JavaScript, high performance and penetrability will always be at the crux of the decisions made by software developers. Svelte is a high-performance component framework for imperative code.
使用JavaScript构建应用程序时,高性能和可穿透性将始终是软件开发人员做出决定的关键。 Svelte是用于命令性代码的高性能组件框架。
Svelte also brings a different way of scaffolding user interfaces to the table. While React and Vue perform most of their work in the browser, Svelte runs during build time by transforming the application’s component into code that updates the DOM.
Svelte还为表提供了一种不同的方式来搭建用户界面。 尽管React和Vue在浏览器中执行其大部分工作,但Svelte会在构建期间通过将应用程序的组件转换为更新DOM的代码来运行。
This tutorial will cover the basics of Svelte and how you can harness its features to build high performance applications.
本教程将介绍Svelte的基础知识,以及如何利用其功能来构建高性能应用程序。
第1步-构建一个精简的应用程序 (Step 1 — Building a Svelte Application)
The first thing to do when building a Svelte application is to integrate Svelte with a project scaffolding tool. This tutorial will use degit
.
构建Svelte应用程序时,要做的第一件事是将Svelte与项目脚手架工具集成在一起。 本教程将使用degit
。
Navigate to your terminal and run the following command to create a new directory for your application:
导航到您的终端并运行以下命令为您的应用程序创建一个新目录:
npx degit sveltjs/template my-svelte-app
npx degit sveltjs / template my-svelte-app
Move into the new directory:
移至新目录:
cd my-svelte-app
cd my-svelte-app
If you are using NPM, install the dependencies with the following command:
如果使用NPM ,请使用以下命令安装依赖项:
- npm install npm安装
If you are using