forked from unplugin/unplugin-vue-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transform.test.ts.snap
85 lines (75 loc) 路 2.66 KB
/
transform.test.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Vitest Snapshot v1
exports[`Component and directive as same name > vue2 transform should work 1`] = `
{
"code": "/* unplugin-vue-components disabled */import __unplugin_directives_0 from 'test/directive/Loading';
import __unplugin_components_0 from 'test/component/Loading';
var render = function () {
this.$options.directives[\\"loading\\"] = __unplugin_directives_0;
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(__unplugin_components_0, {
directives: [
{ name: \\"loading\\", rawName: \\"v-loading\\", value: 123, expression: \\"123\\" }
]
})
}
var staticRenderFns = []
render._withStripped = true
export { render, staticRenderFns }
",
}
`;
exports[`Component and directive as same name > vue3 transform should work 1`] = `
{
"code": "/* unplugin-vue-components disabled */import __unplugin_directives_0 from 'test/directive/ElInfiniteScroll';
import __unplugin_components_0 from 'test/component/ElInfiniteScroll';
const render = (_ctx, _cache) => {
const _component_el_infinite_scroll = __unplugin_components_0
const _directive_el_infinite_scroll = __unplugin_directives_0
return _withDirectives(
(_openBlock(),
_createBlock(_component_test_comp, null, null, 512 /* NEED_PATCH */)),
[[_directive_loading, 123]]
)
}
",
}
`;
exports[`transform > vue2 transform should work 1`] = `
{
"code": "/* unplugin-vue-components disabled */import __unplugin_directives_0 from 'test/directive/Loading';
import __unplugin_components_0 from 'test/component/TestComp';
var render = function () {
this.$options.directives[\\"loading\\"] = __unplugin_directives_0;
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(__unplugin_components_0, {
directives: [
{ name: \\"loading\\", rawName: \\"v-loading\\", value: 123, expression: \\"123\\" }
]
})
}
var staticRenderFns = []
render._withStripped = true
export { render, staticRenderFns }
",
}
`;
exports[`transform > vue3 transform should work 1`] = `
{
"code": "/* unplugin-vue-components disabled */import __unplugin_directives_0 from 'test/directive/Loading';
import __unplugin_components_0 from 'test/component/TestComp';
const render = (_ctx, _cache) => {
const _component_test_comp = __unplugin_components_0
const _directive_loading = __unplugin_directives_0
return _withDirectives(
(_openBlock(),
_createBlock(_component_test_comp, null, null, 512 /* NEED_PATCH */)),
[[_directive_loading, 123]]
)
}
",
}
`;