We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d3041e7 commit 3a37269Copy full SHA for 3a37269
lib/codegen/utils.js
@@ -1,11 +1,20 @@
1
const qs = require('querystring')
2
3
+// these are built-in query parameters so should be ignored
4
+// if the user happen to add them as attrs
5
+const ignoreList = [
6
+ 'id',
7
+ 'index',
8
+ 'src',
9
+ 'type'
10
+]
11
+
12
// transform the attrs on a SFC block descriptor into a resourceQuery string
13
exports.attrsToQuery = (attrs, langFallback) => {
14
let query = ``
15
for (const name in attrs) {
16
const value = attrs[name]
- if (name !== 'src') {
17
+ if (!ignoreList.includes(name)) {
18
query += `&${qs.escape(name)}=${value ? qs.escape(value) : ``}`
19
}
20
0 commit comments