You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/vue/use-with-vue-cli.en-US.md
+28-13Lines changed: 28 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,7 @@
1
-
2
1
# Use in vue-cli 3
3
2
4
3
[vue-cli](https://github.com/vuejs/vue-cli) is one of the best Vue application development tools. We are going to use `antd` within it and modify the webpack config for some customized needs.
5
4
6
-
7
5
## Install and Initialization
8
6
9
7
We need to install `vue-cli` first, you may need install [yarn](https://github.com/yarnpkg/yarn/) too.
@@ -64,22 +62,23 @@ $ yarn add ant-design-vue
64
62
Modify `src/main.js`, import Button component from `antd`.
65
63
66
64
```jsx
67
-
importVuefrom'vue'
68
-
importButtonfrom'ant-design-vue/lib/button'
69
-
import'ant-design-vue/dist/antd.css'
70
-
importAppfrom'./App'
65
+
importVuefrom"vue";
66
+
importButtonfrom"ant-design-vue/lib/button";
67
+
import"ant-design-vue/dist/antd.css";
68
+
importAppfrom"./App";
71
69
72
-
Vue.component(Button.name, Button)
70
+
Vue.component(Button.name, Button);
73
71
74
-
Vue.config.productionTip=false
72
+
Vue.config.productionTip=false;
75
73
76
74
/* eslint-disable no-new */
77
75
newVue({
78
-
el:'#app',
76
+
el:"#app",
79
77
components: { App },
80
-
template:'<App/>'
81
-
})
78
+
template:"<App/>"
79
+
});
82
80
```
81
+
83
82
Modify `src/App.vue`。
84
83
85
84
```jsx
@@ -93,10 +92,8 @@ Modify `src/App.vue`。
93
92
...
94
93
```
95
94
96
-
97
95
Ok, you should now see a blue primary button displayed on the page. Next you can choose any components of `antd` to develop your application. Visit other workflows of `vue-cli` at its [User Guide ](https://github.com/vuejs/vue-cli/blob/master/README.md).
98
96
99
-
100
97
## Advanced Guides
101
98
102
99
We are successfully running antd components now but in the real world, there are still lots of problems about antd-demo.
@@ -112,6 +109,8 @@ Now we need to customize the default webpack config.
Remove the `import 'ant-design-vue/dist/antd.css';` statement added before because `babel-plugin-import` will import styles and import components like below:
0 commit comments