From 6c40e02005e06da91cc202a47aafff360cdbac5f Mon Sep 17 00:00:00 2001 From: ronesam Date: Thu, 21 Feb 2019 18:27:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3npm=20run=20serve=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/vue/use-with-vue-cli.zh-CN.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/vue/use-with-vue-cli.zh-CN.md b/docs/vue/use-with-vue-cli.zh-CN.md index 85f4b97b2a..c4cddc6bc2 100644 --- a/docs/vue/use-with-vue-cli.zh-CN.md +++ b/docs/vue/use-with-vue-cli.zh-CN.md @@ -58,6 +58,12 @@ $ npm run serve $ yarn add ant-design-vue ``` +然后从 yarn 或 npm 安装并引入 less@2.7.3 less-loader (注意:高版本 less 会报错) + +```bash +$ yarn add less@2.7.3 less-loader --save +``` + 修改 `src/main.js`,引入 antd 的按钮组件以及全部样式文件。 ```jsx @@ -76,6 +82,18 @@ new Vue({ components: { App }, template: "" }); + +/* +如果出现: +[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build. + +(found in ) + +请使用: +new Vue({ + render: (h) => h(App) +}).$mount('#app'); +*/ ``` 修改 `src/App.vue`的 template 内容。 @@ -85,7 +103,6 @@ new Vue({
Button> -
... @@ -169,7 +186,7 @@ $ yarn add babel-plugin-import --dev }) ``` -最后重启 `npm run dev` 访问页面,antd 组件的 js 和 css 代码都会按需加载,你在控制台也不会看到这样的[警告信息](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)。关于按需加载的原理和其他方式可以阅读[这里](/docs/vue/getting-started-cn/#按需加载)。 +最后重启 `npm run serve` 访问页面,antd 组件的 js 和 css 代码都会按需加载,你在控制台也不会看到这样的[警告信息](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)。关于按需加载的原理和其他方式可以阅读[这里](/docs/vue/getting-started-cn/#按需加载)。 ### 自定义主题 From 355aa1c0a98c9c1a2177f4a8099d0dff8feadfc8 Mon Sep 17 00:00:00 2001 From: ronesam Date: Thu, 21 Feb 2019 18:30:22 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=84=9A=E6=89=8B=E6=9E=B6npm=20run=20serv?= =?UTF-8?q?er=20=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/vue/use-with-vue-cli.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/vue/use-with-vue-cli.zh-CN.md b/docs/vue/use-with-vue-cli.zh-CN.md index c4cddc6bc2..3bc8641ee2 100644 --- a/docs/vue/use-with-vue-cli.zh-CN.md +++ b/docs/vue/use-with-vue-cli.zh-CN.md @@ -61,7 +61,7 @@ $ yarn add ant-design-vue 然后从 yarn 或 npm 安装并引入 less@2.7.3 less-loader (注意:高版本 less 会报错) ```bash -$ yarn add less@2.7.3 less-loader --save +$ yarn add less@2.7.3 less-loader ``` 修改 `src/main.js`,引入 antd 的按钮组件以及全部样式文件。 From 721d7b2cc342aed66ac2cc1dc5cd75051a2c82a7 Mon Sep 17 00:00:00 2001 From: ronesam Date: Fri, 22 Feb 2019 15:09:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B3=E4=BA=8Eless?= =?UTF-8?q?=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/vue/use-with-vue-cli.zh-CN.md | 34 +++++------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/docs/vue/use-with-vue-cli.zh-CN.md b/docs/vue/use-with-vue-cli.zh-CN.md index 3bc8641ee2..3c84ee3c70 100644 --- a/docs/vue/use-with-vue-cli.zh-CN.md +++ b/docs/vue/use-with-vue-cli.zh-CN.md @@ -18,7 +18,7 @@ $ yarn global add @vue/cli $ vue create antd-demo ``` -并配置项目。 +并配置项目。(注意:使用 cli3 创建项目时,需要手动选择 CSS 预处理,并且选择 `Less` 项。) 工具会自动初始化一个脚手架并安装 Vue 项目的各种必要依赖,如果在过程中出现网络问题,请尝试配置代理或使用其他 npm registry。 @@ -58,12 +58,6 @@ $ npm run serve $ yarn add ant-design-vue ``` -然后从 yarn 或 npm 安装并引入 less@2.7.3 less-loader (注意:高版本 less 会报错) - -```bash -$ yarn add less@2.7.3 less-loader -``` - 修改 `src/main.js`,引入 antd 的按钮组件以及全部样式文件。 ```jsx @@ -76,24 +70,9 @@ Vue.component(Button.name, Button); Vue.config.productionTip = false; -/* eslint-disable no-new */ -new Vue({ - el: "#app", - components: { App }, - template: "" -}); - -/* -如果出现: -[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build. - -(found in ) - -请使用: new Vue({ - render: (h) => h(App) -}).$mount('#app'); -*/ + render: h => h(App) +}).$mount("#app"); ``` 修改 `src/App.vue`的 template 内容。 @@ -178,12 +157,9 @@ $ yarn add babel-plugin-import --dev Vue.config.productionTip = false - /* eslint-disable no-new */ new Vue({ - el: '#app', - components: { App }, - template: '' - }) + render: h => h(App) + }).$mount("#app"); ``` 最后重启 `npm run serve` 访问页面,antd 组件的 js 和 css 代码都会按需加载,你在控制台也不会看到这样的[警告信息](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)。关于按需加载的原理和其他方式可以阅读[这里](/docs/vue/getting-started-cn/#按需加载)。 From 45249a28210bd541d23b3fa468f3d6f6a2adb943 Mon Sep 17 00:00:00 2001 From: ronesam Date: Sat, 23 Feb 2019 14:24:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=85=B3=E4=BA=8Eless?= =?UTF-8?q?=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/vue/use-with-vue-cli.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/vue/use-with-vue-cli.zh-CN.md b/docs/vue/use-with-vue-cli.zh-CN.md index 3c84ee3c70..7c6994b707 100644 --- a/docs/vue/use-with-vue-cli.zh-CN.md +++ b/docs/vue/use-with-vue-cli.zh-CN.md @@ -18,7 +18,7 @@ $ yarn global add @vue/cli $ vue create antd-demo ``` -并配置项目。(注意:使用 cli3 创建项目时,需要手动选择 CSS 预处理,并且选择 `Less` 项。) +并配置项目。 工具会自动初始化一个脚手架并安装 Vue 项目的各种必要依赖,如果在过程中出现网络问题,请尝试配置代理或使用其他 npm registry。