Comments (8)
Thank you for the quick reply, both solutions worked for me. Do you know how "shameful" this experimentalShamefullySupportOptionsApi
is ?
Because I would rather use the Options API as it is in the documentation without the defineComponent
function.
Cheers
from coc-volar.
The latest version was released yesterday via upstream. coc-volar has also been updated. Try run :CocUpdate
and update your extensions
from coc-volar.
Try using defineComponent
.
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
data() {
// ...snip
},
methods: {
// ...snip
},
});
</script>
Or use the <script setup lang="ts">
.
from coc-volar.
@3ximus If you want to use export default { ... }
as it is, try adding a settings. Adding vueCompilerOptions.experimentShamefullySupportOptionsApi
settings to tsconfig.json
may solve the problem.
For projects created in create-vue
(npm init vue
), try adding settings to tsconfig.app.json
.
tsconfig.app.json:
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
// ---- here ----
"vueCompilerOptions": {
"experimentalShamefullySupportOptionsApi": true
}
}
from coc-volar.
This is not a configuration item added by coc-volar
on its own, but by upstream. If you are concerned about the name of the configuration, please submit an issue report upstream.
export default {...}
is of course explained in the official vue documentation and is certainly nothing to be shamefull of. Of course, the same applies when using javascript instead of typescript.
In the current volar, it is recommended to use script setup
or defineComponent
in typescript
because it is less trouble.
from coc-volar.
I see, ok. Thank you for the reply and help.
Cheers π
from coc-volar.
@3ximus It looks like experimentalShamefullySupportOptionsApi
option will be enabled by default in the next upstream update. The diagnostic message appears as a warning, not a error. vuejs/language-tools@e361bdd72aefe4818c5a40e87d11b61672fdf6adA
from coc-volar.
Oh that's great π
Thank you!
from coc-volar.
Related Issues (20)
- `:CocCommand volar.initializeTakeOverMode` get an error!! HOT 2
- notarget No matching version found for @volar/[email protected] HOT 2
- It seems that β@β completion is not supportedοΌ HOT 6
- How to how tsserver commands in takeover mode. HOT 2
- does coc-volar do any intellisense inside template and css block HOT 5
- deprecated dependency HOT 1
- Some CodeActions cannot be executed due to errors HOT 6
- the diagnostic can't be used HOT 7
- file path completion when resolve alias with '@' HOT 2
- Cannot jump to component without `.vue` file extension HOT 1
- Language server does not recognize files that have been added or changed HOT 20
- syntax highlight randomly crashed when editing/scrolling through vue SFC HOT 2
- Diagnostic issue (not showing) HOT 4
- Disable autocompletion source HOT 2
- How to install using self managed registry. HOT 1
- Property 'loading' does not exist on type '{}'. HOT 1
- `vue.autoInsert.bracketSpacing` doesn't seem to work. And syntax highlighting is abnormal. HOT 4
- For me don't work? HOT 5
- works with watchman, renameFile not works. HOT 1
- work with local installed vue code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coc-volar.