@@ -25,6 +25,7 @@ const multipleKindsOfUsingBindingsComponent = `
25
25
attr3="{{this.data3.arr1[0]}}"
26
26
attr4="{{this['data-five']}}"
27
27
@click="{{this.#fn}}"
28
+ onevent="{{this.#fn}}"
28
29
@input="{{this.methods.fn2}}"
29
30
>
30
31
<div>{{ this.#data1 }}</div>
@@ -63,7 +64,11 @@ describe('compileScript', () => {
63
64
const result = compileScript ( descriptor ) ;
64
65
65
66
expect ( result . content ) . toContain ( `get template() {
66
- return [\"\\n <p><!--?pwc_t--></p>\\n\", [this.#text]];
67
+ return {
68
+ templateString: \"\\n <p><!--?pwc_t--></p>\\n\",
69
+ templateData: [this.#text],
70
+ template: true
71
+ };
67
72
}` ) ;
68
73
} ) ;
69
74
@@ -105,27 +110,34 @@ export default class CustomElement extends HTMLElement {
105
110
};
106
111
107
112
get template() {
108
- return ["\\n <!--?pwc_p--><div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n </div>\\n", [[{
109
- name: "attr1",
110
- value: this.#data1
111
- }, {
112
- name: "attr2",
113
- value: this.#data2.name1
114
- }, {
115
- name: "attr3",
116
- value: this.data3.arr1[0]
117
- }, {
118
- name: "attr4",
119
- value: this['data-five']
120
- }, {
121
- name: "onclick",
122
- value: this.#fn,
123
- capture: false
124
- }, {
125
- name: "oninput",
126
- value: this.methods.fn2,
127
- capture: false
128
- }], this.#data1, this.#data2.name1, this.data3.arr1[0], this.data4.obj1.name2, this['data-five']]];
113
+ return {
114
+ templateString: "\\n <!--?pwc_p--><div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n <div><!--?pwc_t--></div>\\n </div>\\n",
115
+ templateData: [[{
116
+ name: "attr1",
117
+ value: this.#data1
118
+ }, {
119
+ name: "attr2",
120
+ value: this.#data2.name1
121
+ }, {
122
+ name: "attr3",
123
+ value: this.data3.arr1[0]
124
+ }, {
125
+ name: "attr4",
126
+ value: this['data-five']
127
+ }, {
128
+ name: "onclick",
129
+ handler: this.#fn,
130
+ capture: false
131
+ }, {
132
+ name: "onevent",
133
+ value: this.#fn
134
+ }, {
135
+ name: "oninput",
136
+ handler: this.methods.fn2,
137
+ capture: false
138
+ }], this.#data1, this.#data2.name1, this.data3.arr1[0], this.data4.obj1.name2, this['data-five']],
139
+ template: true
140
+ };
129
141
}
130
142
131
143
}` ) ;
0 commit comments