<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Vue on Coding</title>
		<link>http://coding.dong.asia/tags/vue/</link>
		<description>Recent content in Vue on Coding</description>
		<generator>Hugo</generator>
		<language>cn</language>
		
		
		
			<copyright>京ICP备17034023号 © 2019 隨風揚</copyright>
		
		
			<lastBuildDate>Mon, 27 Apr 2020 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="http://coding.dong.asia/tags/vue/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>使用Vue CLI构建Vue项目</title>
				<link>http://coding.dong.asia/vue/vuecli/create/</link>
				<pubDate>Mon, 27 Apr 2020 00:00:00 +0000</pubDate>
				<guid>http://coding.dong.asia/vue/vuecli/create/</guid>
				<description>&lt;h2 id=&#34;全局安装vue-cli&#34;&gt;全局安装vue-cli&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;npm install -g @vue/cli&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# OR&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;yarn global add @vue/cli&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Usage: vue &amp;lt;command&amp;gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Options:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -V, --version                              output the version number&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -h, --help                                 output usage information&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Commands:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  create &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &amp;lt;app-name&amp;gt;                create a new project powered by vue-cli-service&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  add &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &amp;lt;plugin&amp;gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;pluginOptions&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;     install a plugin and invoke its generator in an already created project&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  invoke &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &amp;lt;plugin&amp;gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;pluginOptions&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;  invoke the generator of a plugin in an already created project&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  inspect &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;paths...&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;               inspect the webpack config in a project with vue-cli-service&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  serve &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;entry&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;                    serve a .js or .vue file in development mode with zero config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  build &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;entry&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;                    build a .js or .vue file in production mode with zero config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  ui &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;                               start and open the vue-cli ui&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  init &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &amp;lt;template&amp;gt; &amp;lt;app-name&amp;gt;       generate a project from a remote template &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;legacy API, requires @vue/cli-init&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  config &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;value&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;                   inspect and modify the config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  outdated &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;                         &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;experimental&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; check &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; outdated vue cli service / plugins&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  upgrade &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;plugin-name&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;            &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;experimental&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; upgrade vue cli service / plugins&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  migrate &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;options&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;plugin-name&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;            &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;experimental&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; run migrator &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; an already-installed cli plugin&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  info                                       print debugging information about your environment&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  Run vue &amp;lt;command&amp;gt; --help &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; detailed usage of given command.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;可以通过&lt;code&gt;vue init&lt;/code&gt;或&lt;code&gt;vue create&lt;/code&gt;创建项目。&#xA;Vue CLI的包名称由&lt;code&gt;vue-cli&lt;/code&gt;改成了&lt;code&gt;@vue/cli&lt;/code&gt;。如果你已经全局安装了旧版本的vue-cli (1.x 或 2.x)，你需要先通过&lt;code&gt;npm uninstall vue-cli -g&lt;/code&gt;或&lt;code&gt;yarn global remove vue-cli&lt;/code&gt;卸载它。&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
