Skip to content

Commit 99a2d4b

Browse files
authored
chore: add more test case (#231)
* chore: virtualHost remove class com * chore(deps): upgrade * chore(deps): upgrade * fix: eval StringLiteral case * test: add jsStringEscape case * test: add js TemplateElement case * test: UnifiedWebpackPluginV5WithLoader * test: add codecov isTemplateLiteral eval path * chore: add runtimeLoaderPath for internal
1 parent b9f7249 commit 99a2d4b

File tree

15 files changed

+1216
-216
lines changed

15 files changed

+1216
-216
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<image :mode="mode ?? 'widthFix'" :src="src" :style="styles" @load="onLoad" />
3+
</template>
4+
5+
<script setup lang="ts">
6+
import { computed, reactive } from 'vue';
7+
// :class="class"
8+
const props = defineProps<{
9+
mode?: string;
10+
src: string;
11+
style?: object;
12+
// class?: string
13+
}>();
14+
15+
const rect = reactive({
16+
width: 0,
17+
height: 0,
18+
});
19+
const styles = computed(() => ({
20+
width: rect.width + 'rpx',
21+
height: rect.height + 'rpx',
22+
...props.style,
23+
}));
24+
25+
function onLoad(event: { detail: { width: number, height: number } }) {
26+
const { detail } = event // as { detail: { width: number, height: number } };
27+
rect.width = detail.width;
28+
rect.height = detail.height;
29+
}
30+
</script>
31+
32+
<script lang="ts">
33+
import { defineComponent } from 'vue'
34+
export default defineComponent({
35+
name: 'NImage',
36+
mixins: [
37+
{
38+
options: {
39+
virtualHost: true,
40+
}
41+
}
42+
]
43+
})
44+
</script>

demo/uni-app-vue3-vite/src/pages/index/index.vue

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
22
<view class="content">
3+
<Issue228 class="mt-[96.3px] w-[61.1px] h-[50.99px]"
4+
src="https://pic1.zhimg.com/v2-3ee20468f54bbfefcd0027283b21aaa8_720w.jpg"></Issue228>
35
<view>{{ wildContent }}</view>
46
<n-image class="mt-[26.2px] w-[43.1px] h-[42.99px]"></n-image>
57
<NHostImage class="mt-[96.3px] w-[61.1px] h-[50.99px]"></NHostImage>
@@ -90,6 +92,7 @@
9092

9193

9294
<script setup lang="ts">
95+
import Issue228 from '@/components/Issue228.vue';
9396
import CommonCom from '@/components/CommonCom.vue'
9497
import VirtualHostCom from '@/components/VirtualHostCom.vue'
9598
import NImage from '@/components/NImage.vue';

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"@rollup/plugin-alias": "^5.0.0",
150150
"@rollup/plugin-commonjs": "^25.0.4",
151151
"@rollup/plugin-json": "^6.0.0",
152-
"@rollup/plugin-node-resolve": "^15.1.0",
152+
"@rollup/plugin-node-resolve": "^15.2.0",
153153
"@rollup/plugin-terser": "^0.4.3",
154154
"@rollup/plugin-typescript": "^11.1.2",
155155
"@tsconfig/recommended": "^1.0.2",
@@ -164,12 +164,12 @@
164164
"@types/loader-utils": "^2.0.3",
165165
"@types/lodash": "^4.14.197",
166166
"@types/micromatch": "^4.0.2",
167-
"@types/node": "^20.5.0",
167+
"@types/node": "^20.5.1",
168168
"@types/semver": "^7.5.0",
169169
"@types/vinyl": "^2.0.7",
170170
"@types/webpack": "^5.28.1",
171171
"@types/webpack-sources": "^3.2.0",
172-
"@vitest/coverage-v8": "^0.34.1",
172+
"@vitest/coverage-v8": "^0.34.2",
173173
"autoprefixer": "^10.4.15",
174174
"babel-loader": "^9.1.3",
175175
"bumpp": "^9.1.1",
@@ -179,6 +179,7 @@
179179
"dedent": "^1.5.1",
180180
"defu": "6.1.2",
181181
"del": "^7.0.0",
182+
"domhandler": "^5.0.3",
182183
"eslint": "8.47.0",
183184
"eslint-config-icebreaker": "^1.2.2",
184185
"eslint-config-prettier": "^9.0.0",
@@ -199,7 +200,7 @@
199200
"postcss-load-config": "^4.0.1",
200201
"postcss-loader": "^7.3.3",
201202
"postcss-rem-to-responsive-pixel": "^5.1.3",
202-
"prettier": "^3.0.1",
203+
"prettier": "^3.0.2",
203204
"promisify-loader-runner": "^1.0.0",
204205
"rollup": "^3.28.0",
205206
"rollup-plugin-visualizer": "^5.9.2",
@@ -210,16 +211,15 @@
210211
"ts-node": "^10.9.1",
211212
"ts-patch": "^3.0.2",
212213
"tsd": "^0.28.1",
213-
"tslib": "^2.6.1",
214+
"tslib": "^2.6.2",
214215
"typescript": "^5.1.6",
215216
"typescript-transform-paths": "^3.4.6",
216217
"vinyl": "^3.0.0",
217218
"vite": "^4.4.9",
218-
"vitest": "^0.34.1",
219+
"vitest": "^0.34.2",
219220
"weapp-tailwindcss-children": "^0.1.0",
220221
"webpack": "^5.88.2",
221-
"webpack-build-utils": "^0.0.4",
222-
"domhandler": "^5.0.3"
222+
"webpack-build-utils": "^0.0.4"
223223
},
224224
"dependencies": {
225225
"@babel/generator": "^7.22.10",
@@ -234,10 +234,10 @@
234234
"loader-utils": "^2.0.3",
235235
"magic-string": "^0.30.2",
236236
"micromatch": "^4.0.5",
237-
"postcss": "8.4.27",
237+
"postcss": "8.4.28",
238238
"postcss-selector-parser": "^6.0.13",
239239
"semver": "^7.5.4",
240-
"tailwindcss-patch": "^2.1.0"
240+
"tailwindcss-patch": "^2.1.1"
241241
},
242242
"packageManager": "[email protected]",
243243
"engines": {

0 commit comments

Comments
 (0)