Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 5304aff

Browse files
committed
chore: update tests
1 parent 3ea6e42 commit 5304aff

File tree

10 files changed

+204
-184
lines changed

10 files changed

+204
-184
lines changed

examples/vue-cli/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"vue": "^2.6.11"
1212
},
1313
"devDependencies": {
14-
"@vue/cli-plugin-babel": "~4.5.13",
15-
"@vue/cli-plugin-typescript": "~4.5.13",
16-
"@vue/cli-service": "~4.5.13",
17-
"typescript": "~4.3.5",
14+
"@vue/cli-plugin-babel": "^4.5.13",
15+
"@vue/cli-plugin-typescript": "^4.5.13",
16+
"@vue/cli-service": "^4.5.13",
17+
"typescript": "^4.3.5",
1818
"unplugin-vue2-script-setup": "workspace:*",
1919
"vue-template-compiler": "^2.6.14",
2020
"vue-tsc": "^0.3.0"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"@babel/types": "^7.15.0",
9494
"@vue/ref-transform": "^3.2.6",
9595
"@vue/shared": "^3.2.6",
96-
"htmlparser2": "^7.0.0",
96+
"htmlparser2": "^6.0.1",
9797
"magic-string": "^0.25.7",
9898
"unplugin": "^0.2.0"
9999
}

playground/HelloWorld.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
</template>
1212

1313
<script setup lang="ts">
14-
import { ref, computed, watch } from '@vue/composition-api'
14+
import { watch } from '@vue/composition-api'
1515
import Foo from './Foo.vue'
1616
import Bar from './Bar.vue'
1717
1818
const props = withDefaults(defineProps<{ msg: string; name: string | number }>(), { msg: 'Hello' })
1919
const emit = defineEmits(['update'])
2020
21-
const count = ref(0)
22-
const doubled = computed(() => count.value * 2)
21+
let count = $ref(0)
22+
// eslint-disable-next-line prefer-const
23+
let doubled = $computed(() => count * 2)
2324
2425
function inc() {
25-
count.value += 1
26+
count += 1
2627
}
27-
2828
function dec() {
29-
count.value -= 1
29+
count -= 1
3030
}
3131
3232
const decText = '<b>Dec</b>'

playground/vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export default defineConfig({
77
plugins: [
88
Vue2(),
99
Inspect(),
10-
ScriptSetup(),
10+
ScriptSetup({
11+
refTransform: true,
12+
}),
1113
],
1214
})

pnpm-lock.yaml

Lines changed: 6 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function transformVue(input: string, id: string, options: ResolvedOptions): Tran
3838

3939
const sfc = parseSFC(input, id)
4040

41-
if (options?.refTransform)
41+
if (options.refTransform)
4242
transformSfcRefSugar(sfc, options)
4343

4444
const { code } = transformScriptSetup(sfc, options)

0 commit comments

Comments
 (0)