php framework laravel build vue3 use defineModel not run #12663
Unanswered
422190916
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
laravel version 8.5
use
npm install vue
command to install vueuse
npm install ts-loader
command to install ts-loaderuse
npm install typescript
command to install typescriptpackage.json:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"vue-loader": "^16.8.0"
},
"dependencies": {
"ts-loader": "^9.5.1",
"typescript": "^5.7.2",
"vue": "^3.5.13",
"vue-router": "^4.5.0",
"webpack-cli": "^6.0.1"
}
}
vue code:
<script lang="ts" setup> const modelValue = defineModel() modelValue.value = "hello" </script>vue3
npm run watch
✖ Mix
Compiled with some errors in 18.32s
ERROR in Join.vue.ts
14:29-35
[tsl] ERROR in Join.vue.ts(14,30)
TS2558: Expected 3-5 type arguments, but got 1.
ERROR in Join.vue.ts
15:0-16
[tsl] ERROR in Join.vue.ts(15,1)
TS2322: Type 'string' is not assignable to type 'T[K]'.
'string' is assignable to the constraint of type 'T[K]', but 'T[K]' could be instantiated with a different subtype of constraint 'any'.
webpack compiled with 2 errors
Beta Was this translation helpful? Give feedback.
All reactions