Vuetify 프로젝트를 바로 시작하려면 (공식 예제를 바탕으로한) Vuetify Vue CLI 패키지를 사용하세요. Vuetify는 SSR (서버사이드 렌더링), SPA (싱글페이지 어플리케이션), PWA (프로그레시브 웹 어플리케이션)와 단독 HTML 페이지를 지원합니다.
Vuetify는 웹개발의 다음 단계로 나아가는 것을 추구하는 진보적인 프레임웤입니다. 이 과업을 성취하기 위해, 오래된 버변의 인터넷 익스플로러를 지원하지 않는 다소의 희생이 있어야만 했습니다. 이 리스트는 호환되는 브라우져에 대한 완벽한 리스트는 아니지만 주로 지원하는 브라우져들입니다.
Vue-CLI 3 is the next generation cli tool made to help you get started more easily than before. When you start your app with vue-cli you will also be able to get the official webpack updates and config changes, as well as Vuetify's updates without an arduous upgrade process.
Once the cli is installed, you can generate a new project scaffold. Select the default install unless you have specific packages that you need to include (e.g. vuex or vue-router). This will create a new Vue project that's ready to go with your selected options.
Tip: If you already have Vue CLI installed, you can check if you are on the latest version by typing vue --version from your terminal.
Now that you have an instantiated project, you can add the Vuetify package using the cli.
This will provide you with a set of options for customizing your installation. The default preset has a-la-carte already enabled for you.
After installation simply run yarn serve or npm run serve to start your application.
Vue UI Install
Vuetify can also be installed using Vue UI, the new visual application for @vue/cli. Ensure that you have the latest version of Vue CLI installed, then from your terminal type:
This will start the Vue User Interface and open a new window in your browser. On the left side of your screen, click on Plugins. Once navigated, simply search for Vuetify in the input field.
After installation, you will have the option to configure your application's default Vuetify settings.
Vuetify를 기존 프로젝트에 적용하려면 Vuetify를 node_modules에 반드시 설치해야 합니다. 이를 위해
yarn을 사용할 수 있습니다. 이 두 패키지 매니져는 당신의 어플리케이션에 사용되는 리소스를 관리할 수 있도록 해줍니다.
For a detailed explanation of how to get
npm running in your environment, check out the official npm documentation. Alternatively, if you wish to use yarn, you can find more information on the official yarn documentation. Once setup, you can run either command from the cli.
Once Vuetify has been installed, create a folder within you
src directory called
plugins. Inside, add a vuetify.js file. This is where we will handle all of our bootstrapping and setup of Vuetify for your project.
경고: Vuetify 는 css 충돌을 최대한 줄이려고 노력하지만, Vuetify 를 기존의 프로젝트의 추가할때 당신의 커스텀 스타일들과 문제를 만들지 않을 거라고 보장하지는 못합니다.
There are three ways in which you can install Vuetify. The first (and recommended) way is to utilize the vuetify-loader or what we call automatic A-la-carte. This will ensure that your application only uses the features and styles from Vuetify that are needed, significantly reducing your application's compiled size. Keep in mind, when importing from
vuetify/lib, the necessary styles are automatically imported for you.
If there is a reason you are unable to utilize the vue-cli-plugin package, you can manually install the vuetify-loader through your vue.config.js or webpack config. For more information on manual installation, navigate to the A-la-carte page.
You can also manually import individual components without the need for the vuetify-loader. This is considered manual A-la-carte.
The last method will import and setup all of Vuetify's features and styles. As stated above, it is still recommended that you utilize the vuetify-loader if at all possible. For this install, you will need to manually import the Vuetify styles. This is also the process used when bootstrapping Vuetify through a browser as opposed to compiling. You can observe the browser installation in our cdn quickstart.
When using webpack, you have the ability to setup your application with either of the above options (Full or A-la-carte install). However, you will need to configure add a webpack rule (or modify an existing one) for sass files. You can start by installing the necessary dependencies:
Once installed, locate your
webpack.config.js file and copy the snippet below into the rules array. If you have an existing sass rule configured, you may need to apply some or all of the changes below. If you are you looking to utilize the vuetify-loader as well, you can find more information on setting it up with webpack on the A-la-carte page.
Bootstrapping the Vuetify Object
Once you have setup your initial Vuetify options in your
src/plugins/vuetify.js file, you must then pass that object into your main Vue instance options. This install process is similar to vue-router and vuex
Vuetify uses the Google Roboto font per the Material Design Specification. The easiest way to use this font is by add a
<link> element in the
<head> of your main
You can also asynchronously load the fonts by using the webfontloader.
Vuetify uses Material Design Icons as its default iconfont. The simplest way to install it is through
Once the package is installed, simply import it into the
vuetify.js file in your plugins folder.
For more information on different support iconfonts and advanced implementations, navigate to the Icons page.
To test using Vuetify.js without installing a template from Vue CLI, copy the code below into your
index.html. This will pull the latest version of Vue and Vuetify, allowing you to start playing with components. You can also use the Vuetify starter on codepen. While not recommended, if you need to utilize the cdn packages in a production environment, it is recommended that you scope the versions of your assets. For more information on how to do this, navigate to the jsdelivr website.
IE11 & Safari 9 지원
babel-polyfill을 설치하고 메인 엔트리에서 import 하세요
<template> 태그를 제대로 지원하지 못하기 때문에 항상 완전히 컴파일된 DOM 요소들을 브라우져로 보내야 합니다. This can be done by either building your Vue code in advance or by creating helper components to replace the dom elements. For instance, if sent directly to IE, this will fail:
It is recommended that you use
babel-preset-env with the corresponding polyfill to ensure only the necessary polyfills are added to your application. For more information on
babel-present-env, visit the documentation
Once installed, add the preset to your
Unfortunately vue-cli-3 doesn't automatically bring IE11 compatibility in which you may encounter various errors (such as Symbol is not defined). To assist in resolving these errors you may need to manually add
transpileDependencies parameter in
Due to Internet Explorer's limited support for
<template> tags, you must send fully compiled dom elements to the browser. This can be done by either building your Vue code in advance or by creating helper components to replace the dom elements. For instance, if sent directly to IE, this will fail: