UNPKG
shendu-portal-plugin-vue
Version:
latest (1.0.35)
1.0.35
1.0.34
1.0.33
1.0.32
1.0.31
1.0.30
1.0.29
shendu-portal-plugin-vue
/
src
/
data-option.js
24 lines
(23 loc)
•
373 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module.exports =
function
(ast) { const script = ast.parseOptions && ast.parseOptions.language ===
'vue'
? ast.find(
'<script></script>'
) : ast; script.replace( `{ data: { $$
$1
}, $$
$2
}`, `{
data
() {
return
{ $$
$1
} }, $$
$2
}` );
return
ast; };