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: README.md
+34-2
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,38 @@ module.exports = {
62
62
}
63
63
```
64
64
65
+
### Functional Component
66
+
67
+
If you want to use functional component template, you need to set `functional: true` option to loader options. You may want to use `oneOf` to handle both normal and functional template configs.
68
+
69
+
```js
70
+
module.exports= {
71
+
module: {
72
+
rules: [
73
+
{
74
+
test:/\.html$/,
75
+
oneOf: [
76
+
// If the file name has `.functional` suffix, treat it as functional component template
77
+
// You can change this rule whatever you want.
78
+
{
79
+
test:/\.functional\.html$/,
80
+
loader:'vue-template-loader',
81
+
options: {
82
+
functional:true
83
+
}
84
+
},
85
+
86
+
// Normal component template
87
+
{
88
+
loader :'vue-template-loader'
89
+
}
90
+
]
91
+
}
92
+
]
93
+
}
94
+
}
95
+
```
96
+
65
97
### Loading Scoped Styles
66
98
67
99
For an explanation of scoped styles, see the [vue-loader docs](https://vue-loader.vuejs.org/en/features/scoped-css.html).
@@ -240,9 +272,9 @@ If you use this loader with TypeScript, make sure to add a declaration file for
0 commit comments