- version:v1.0.55
- playground demo:
转义前代码:
<template>
<el-select
v-model="selected"
clearable
></el-select>
</template>
transform.js
function transform(fileInfo, api, options) {
const $ = api.gogocode
const source = fileInfo.source
const ast = $(source, { parseOptions: { language: 'vue' } })
const template = ast.find('<template></template>')
const script = ast.find('<script></script>')
template.replace('<el-select clearable $$$1>$$$2</el-select>', '<el-select allowClear $$$1>$$$2</el-select>')
return ast.generate()
}
vscode插件没有匹配上标签,但是在线的playground可以
vscode插件:

在线playground:

转义前代码:
transform.js
vscode插件没有匹配上标签,但是在线的playground可以


vscode插件:
在线playground: