Skip to content

Commit 19f1366

Browse files
committed
feat(compiler): support map call expression
1 parent e6f5922 commit 19f1366

File tree

17 files changed

+942
-533
lines changed

17 files changed

+942
-533
lines changed

.changeset/green-beers-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'unplugin-vue-jsx-vapor': patch
3+
---
4+
5+
support map call expression

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export default sxzz({
55
'unicorn/filename-case': 'off',
66
'import/no-default-export': 'off',
77
'unused-imports/no-unused-vars': 'warn',
8+
'unicorn/no-new-array': 'off',
89
},
910
})

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
"typecheck": "tsc --noEmit",
9090
"lint": "eslint .",
9191
"play": "npm -C playground run dev",
92-
"prepublishOnly": "npm run build",
9392
"release": "bumpp && npm publish",
9493
"publish": "pnpm build && changeset publish",
9594
"start": "esno src/index.ts",
@@ -126,36 +125,37 @@
126125
"dependencies": {
127126
"@babel/parser": "^7.24.7",
128127
"@vue-macros/common": "^1.10.4",
129-
"@vue-vapor/compiler-core": "3.2024.0-4c28469",
130-
"@vue-vapor/compiler-dom": "3.2024.0-63dbc26",
131-
"@vue-vapor/compiler-vapor": "3.2024.0-63dbc26",
132-
"@vue-vapor/runtime-vapor": "3.2024.0-63dbc26",
133-
"@vue-vapor/shared": "3.2024.0-4c28469",
134-
"@vue-vapor/vue": "3.2024.0-63dbc26",
128+
"@vue-vapor/compiler-core": "3.20240702.0-b44ca85",
129+
"@vue-vapor/compiler-dom": "3.20240702.0-b44ca85",
130+
"@vue-vapor/compiler-vapor": "3.20240702.0-b44ca85",
131+
"@vue-vapor/runtime-vapor": "3.20240702.0-b44ca85",
132+
"@vue-vapor/shared": "3.20240702.0-b44ca85",
133+
"@vue-vapor/vue": "3.20240702.0-b44ca85",
135134
"html-tags": "^4.0.0",
135+
"source-map-js": "^1.2.0",
136136
"svg-tags": "^1.0.0",
137-
"unplugin": "^1.10.1"
137+
"unplugin": "^1.11.0"
138138
},
139139
"devDependencies": {
140-
"@antfu/eslint-config": "^2.21.1",
140+
"@antfu/eslint-config": "^2.21.2",
141141
"@babel/types": "^7.24.7",
142142
"@changesets/changelog-github": "^0.5.0",
143-
"@changesets/cli": "^2.27.6",
144-
"@nuxt/kit": "^3.12.2",
145-
"@nuxt/schema": "^3.12.2",
143+
"@changesets/cli": "^2.27.7",
144+
"@nuxt/kit": "^3.12.3",
145+
"@nuxt/schema": "^3.12.3",
146146
"@sxzz/eslint-config": "^3.13.0",
147147
"@types/node": "^20.14.9",
148148
"@types/svg-tags": "^1.0.2",
149149
"bumpp": "^9.4.1",
150150
"chalk": "^5.3.0",
151-
"eslint": "^9.5.0",
151+
"eslint": "^9.6.0",
152152
"esno": "^4.7.0",
153153
"fast-glob": "^3.3.2",
154154
"nodemon": "^3.1.4",
155155
"rimraf": "^5.0.7",
156156
"rollup": "^4.18.0",
157157
"tsup": "^8.1.0",
158-
"typescript": "^5.5.2",
158+
"typescript": "^5.5.3",
159159
"vite": "^5.3.2",
160160
"vitest": "^1.6.0",
161161
"webpack": "^5.92.1"

playground/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { defineComponent, ref } from 'vue'
33
import Count2 from './Count.vue'
44
import If from './if.vue'
5+
import For from './for.vue'
56
67
export default defineComponent({
78
setup() {
@@ -33,6 +34,11 @@ export default defineComponent({
3334
<legend>v-if</legend>
3435
<If></If>
3536
</fieldset>
37+
38+
<fieldset>
39+
<legend>v-for</legend>
40+
<For></For>
41+
</fieldset>
3642
</>
3743
)
3844
},

playground/for.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script lang="tsx">
2+
import { defineComponent, ref } from 'vue'
3+
4+
export default defineComponent({
5+
setup() {
6+
const count = ref(3)
7+
8+
return (
9+
<div style="text-align:center">
10+
<input value={count.value} onInput={e => count.value = e.target.value} type="number" />
11+
12+
{Array.from({length: count.value}).map((item,index) =>{
13+
if(item > 1){
14+
return <div>({index}) lg 1</div>
15+
} else {
16+
return <div>({index}) lt 1</div>
17+
}
18+
})}
19+
</div>
20+
)
21+
},
22+
})
23+
</script>

0 commit comments

Comments
 (0)