-
-
Notifications
You must be signed in to change notification settings - Fork 334
/
transform.test.ts.snap
123 lines (109 loc) 路 3.89 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// 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 > vue2.7 transform should work 1`] = `
{
"code": "/* unplugin-vue-components disabled */import __unplugin_directives_0 from 'test/directive/Loading';
import __unplugin_components_0 from 'test/component/Div';
import { defineComponent as _defineComponent } from \\"vue\\";
const _sfc_main = /* @__PURE__ */ _defineComponent({
__name: \\"App\\",
setup(__props) {
return { __sfc: true };
}
});
var _sfc_render = function render() {
this.$options.directives[\\"loading\\"] = __unplugin_directives_0;
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
return _c(__unplugin_components_0, { directives: [{ name: \\"loading\\", rawName: \\"v-loading\\", value: 123, expression: \\"123\\" }] }, [], 1);
};
",
}
`;
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 > vue2 transform with jsx should work 1`] = `
{
"code": "/* unplugin-vue-components disabled */import __unplugin_components_0 from 'test/component/TestComp';
export default {
render(){
return h(__unplugin_components_0, {
directives: [
{ name: \\"loading\\", rawName: \\"v-loading\\", value: 123, expression: \\"123\\" }
]
})
}
}
",
}
`;
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]]
)
}
",
}
`;